SERVER/FTE: Re-introduce trace penetration for Zombies

This commit is contained in:
cypress 2023-11-08 11:50:48 -05:00
parent 4e88aa404a
commit 3de18c324c
2 changed files with 28 additions and 38 deletions

View file

@ -824,56 +824,46 @@ void() Do_Zombie_AI = {
void() AI_SetAllEnemiesBBOX = void() AI_SetAllEnemiesBBOX =
{ {
entity list; entity zombies = find(world, classname, "ai_zombie");
// First target zombies while(zombies != world) {
list = find(world, classname, "ai_zombie"); zombies.last_solid = zombies.solid;
while (list != world) { zombies.solid = SOLID_BBOX;
list.last_solid = list.solid;
list.solid = SOLID_BBOX;
list.had_solid_modified = true;
if (list.head) { if (zombies.head) {
list.head.last_solid = list.head.solid; zombies.head.last_solid = zombies.head.solid;
list.head.solid = SOLID_BBOX; zombies.head.solid = SOLID_BBOX;
list.head.had_solid_modified = true;
}
if (list.larm) {
list.larm.last_solid = list.larm.solid;
list.larm.solid = SOLID_BBOX;
list.larm.had_solid_modified = true;
}
if (list.rarm) {
list.rarm.last_solid = list.rarm.solid;
list.rarm.solid = SOLID_BBOX;
list.larm.had_solid_modified = true;
} }
list = find(list, classname, "ai_zombie"); if (zombies.larm) {
} zombies.larm.last_solid = zombies.larm.solid;
zombies.larm.solid = SOLID_BBOX;
}
// Now Dogs if (zombies.rarm) {
list = find(world, classname, "ai_dog"); zombies.rarm.last_solid = zombies.rarm.solid;
while (list != world) { zombies.rarm.solid = SOLID_BBOX;
list.last_solid = list.solid; }
list.solid = SOLID_BBOX;
list.had_solid_modified = true;
list = find(list, classname, "ai_dog"); zombies = find(zombies, classname, "ai_zombie");
} }
} }
void() AI_RevertEnemySolidState = void() AI_RevertEnemySolidState =
{ {
entity list; entity zombies = find(world, classname, "ai_zombie");
list = findfloat(world, had_solid_modified, true); while(zombies != world) {
zombies.solid = zombies.last_solid;
while (list != world) { if (zombies.head)
list.solid = list.last_solid; zombies.head.solid = zombies.head.last_solid;
list.had_solid_modified = false; if (zombies.larm)
zombies.larm.solid = zombies.larm.last_solid;
if (zombies.rarm)
zombies.rarm.solid = zombies.rarm.last_solid;
list = findfloat(list, had_solid_modified, true); zombies = find(zombies, classname, "ai_zombie");
} }
} }

View file

@ -949,7 +949,7 @@ void (float shotcount, float sprd, float Damage, float side) FireTrace =
#ifdef FTE #ifdef FTE
//AI_SetAllEnemiesBBOX(); AI_SetAllEnemiesBBOX();
#endif // FTE #endif // FTE
@ -957,7 +957,7 @@ void (float shotcount, float sprd, float Damage, float side) FireTrace =
#ifdef FTE #ifdef FTE
//AI_RevertEnemySolidState(); AI_RevertEnemySolidState();
#endif // FTE #endif // FTE