mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2025-10-30 08:01:28 +00:00
Make linedef 96 apply to tags from 97-99, but not to itself
This commit is contained in:
parent
96976fdba3
commit
1d7fa9e0f5
1 changed files with 42 additions and 35 deletions
|
|
@ -3136,48 +3136,55 @@ static void P_AddBinaryMapTags(void)
|
||||||
{
|
{
|
||||||
size_t i;
|
size_t i;
|
||||||
|
|
||||||
for (i = 0; i < numlines; i++)
|
for (i = 0; i < numlines; i++) {
|
||||||
{
|
|
||||||
// 96: Apply Tag to Tagged Sectors
|
|
||||||
// 97: Apply Tag to Front Sector
|
// 97: Apply Tag to Front Sector
|
||||||
// 98: Apply Tag to Back Sector
|
// 98: Apply Tag to Back Sector
|
||||||
// 99: Apply Tag to Front and Back Sectors
|
// 99: Apply Tag to Front and Back Sectors
|
||||||
if (lines[i].special == 96) {
|
if (lines[i].special == 97 || lines[i].special == 99)
|
||||||
size_t j;
|
P_AddBinaryMapTagsFromLine(lines[i].frontsector, &lines[i]);
|
||||||
mtag_t tag = Tag_FGet(&lines[i].frontsector->tags);
|
if (lines[i].special == 98 || lines[i].special == 99)
|
||||||
mtag_t target_tag = Tag_FGet(&lines[i].tags);
|
P_AddBinaryMapTagsFromLine(lines[i].backsector, &lines[i]);
|
||||||
mtag_t offset_tags[4];
|
}
|
||||||
memset(offset_tags, 0, sizeof(mtag_t)*4);
|
|
||||||
if (lines[i].flags & ML_EFFECT6) {
|
|
||||||
offset_tags[0] = (INT32)sides[lines[i].sidenum[0]].textureoffset / FRACUNIT;
|
|
||||||
offset_tags[1] = (INT32)sides[lines[i].sidenum[0]].rowoffset / FRACUNIT;
|
|
||||||
}
|
|
||||||
if (lines[i].flags & ML_TFERLINE) {
|
|
||||||
offset_tags[2] = (INT32)sides[lines[i].sidenum[1]].textureoffset / FRACUNIT;
|
|
||||||
offset_tags[3] = (INT32)sides[lines[i].sidenum[1]].rowoffset / FRACUNIT;
|
|
||||||
}
|
|
||||||
|
|
||||||
for (j = 0; j < numsectors; j++) {
|
// Run this loop after the 97-99 loop to ensure that 96 can search through all of the
|
||||||
boolean matches_target_tag = target_tag && Tag_Find(§ors[j].tags, target_tag);
|
// 97-99-applied tags.
|
||||||
size_t k; for (k = 0; k < 4; k++) {
|
for (i = 0; i < numlines; i++) {
|
||||||
if (lines[i].flags & ML_EFFECT5) {
|
size_t j;
|
||||||
if (matches_target_tag || (offset_tags[k] && Tag_Find(§ors[j].tags, offset_tags[k]))) {
|
mtag_t tag, target_tag;
|
||||||
Tag_Add(§ors[j].tags, tag);
|
mtag_t offset_tags[4];
|
||||||
break;
|
|
||||||
}
|
// 96: Apply Tag to Tagged Sectors
|
||||||
} else if (matches_target_tag) {
|
if (lines[i].special != 96)
|
||||||
if (k == 0)
|
continue;
|
||||||
Tag_Add(§ors[j].tags, tag);
|
|
||||||
if (offset_tags[k])
|
tag = Tag_FGet(&lines[i].frontsector->tags);
|
||||||
Tag_Add(§ors[j].tags, offset_tags[k]);
|
target_tag = Tag_FGet(&lines[i].tags);
|
||||||
|
memset(offset_tags, 0, sizeof(mtag_t)*4);
|
||||||
|
if (lines[i].flags & ML_EFFECT6) {
|
||||||
|
offset_tags[0] = (INT32)sides[lines[i].sidenum[0]].textureoffset / FRACUNIT;
|
||||||
|
offset_tags[1] = (INT32)sides[lines[i].sidenum[0]].rowoffset / FRACUNIT;
|
||||||
|
}
|
||||||
|
if (lines[i].flags & ML_TFERLINE) {
|
||||||
|
offset_tags[2] = (INT32)sides[lines[i].sidenum[1]].textureoffset / FRACUNIT;
|
||||||
|
offset_tags[3] = (INT32)sides[lines[i].sidenum[1]].rowoffset / FRACUNIT;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (j = 0; j < numsectors; j++) {
|
||||||
|
boolean matches_target_tag = target_tag && Tag_Find(§ors[j].tags, target_tag);
|
||||||
|
size_t k;
|
||||||
|
for (k = 0; k < 4; k++) {
|
||||||
|
if (lines[i].flags & ML_EFFECT5) {
|
||||||
|
if (matches_target_tag || (offset_tags[k] && Tag_Find(§ors[j].tags, offset_tags[k]))) {
|
||||||
|
Tag_Add(§ors[j].tags, tag);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
} else if (matches_target_tag) {
|
||||||
|
if (k == 0)
|
||||||
|
Tag_Add(§ors[j].tags, tag);
|
||||||
|
if (offset_tags[k])
|
||||||
|
Tag_Add(§ors[j].tags, offset_tags[k]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
if (lines[i].special == 97 || lines[i].special == 99)
|
|
||||||
P_AddBinaryMapTagsFromLine(lines[i].frontsector, &lines[i]);
|
|
||||||
if (lines[i].special == 98 || lines[i].special == 99)
|
|
||||||
P_AddBinaryMapTagsFromLine(lines[i].backsector, &lines[i]);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue