Merge branch 'issue1175' into 'next'

ML_BOUNCY will count pushables in all sectors the line is tagged to

See merge request STJr/SRB2!2368
This commit is contained in:
SSNTails 2025-03-20 18:41:13 +00:00
commit a67ee77782

View file

@ -1529,12 +1529,31 @@ static boolean P_CheckPushables(line_t *triggerline, sector_t *caller)
if (!caller)
return false; // we need a calling sector to find pushables in, silly!
// Count the pushables in this sector
for (node = caller->touching_thinglist; node; node = node->m_thinglist_next)
if (triggerline->flags & ML_BOUNCY) // Count pushables in ALL sectors this line is tagged to
{
mo = node->m_thing;
if ((mo->flags & MF_PUSHABLE) || ((mo->info->flags & MF_PUSHABLE) && mo->fuse))
numpushables++;
for (size_t i = 0; i < numsectors; i++)
{
if (sectors[i].triggertag != caller->triggertag)
continue;
// Count the pushables in this sector
for (node = sectors[i].touching_thinglist; node; node = node->m_thinglist_next)
{
mo = node->m_thing;
if ((mo->flags & MF_PUSHABLE) || ((mo->info->flags & MF_PUSHABLE) && mo->fuse))
numpushables++;
}
}
}
else
{
// Count the pushables in this sector
for (node = caller->touching_thinglist; node; node = node->m_thinglist_next)
{
mo = node->m_thing;
if ((mo->flags & MF_PUSHABLE) || ((mo->info->flags & MF_PUSHABLE) && mo->fuse))
numpushables++;
}
}
switch (triggerline->args[2])