NSMonster: use PMoveCustom_RunStandardPlayerPhysics instead of the engine, as it overrides

our hitcontentsmask. This is required for monster/bot clips.
Client: If an entity gets removed, ensure the .skeletonindex gets deleted.
This commit is contained in:
Marco Cawthorne 2022-04-09 19:21:00 -07:00
parent 7f440a2885
commit 6b1af093bb
Signed by: eukara
GPG key ID: C196CD8BA993248A
4 changed files with 12 additions and 3 deletions

View file

@ -729,6 +729,10 @@ CSQC_Ent_Remove(void)
if (self.isCSQC) {
NSEntity me = (NSEntity)self;
me.ClientRemove();
if (me.skeletonindex)
skel_delete(me.skeletonindex);
remove(self);
} else {
remove(self);

View file

@ -543,7 +543,8 @@ NSMonster::NewRoute(vector destination)
}
}
const int CONTENTBITS_MONSTER = CONTENTBIT_SOLID|0x00000002i|CONTENTBIT_BODY|CONTENTBIT_MONSTERCLIP;
const int CONTENTBITS_MONSTER = CONTENTBIT_SOLID|CONTENTBIT_BODY|CONTENTBIT_MONSTERCLIP|CONTENTBIT_BOTCLIP;
void PMoveCustom_RunPlayerPhysics(entity target);
void
NSMonster::Physics(void)
@ -568,7 +569,7 @@ NSMonster::Physics(void)
WalkRoute();
hitcontentsmaski = CONTENTBITS_MONSTER;
runstandardplayerphysics(this);
PMoveCustom_RunPlayerPhysics(this);
SetOrigin(origin);
IdleNoise();

View file

@ -510,7 +510,8 @@ NSTalkMonster::Physics(void)
}
CheckRoute();
WalkRoute();
runstandardplayerphysics(this);
hitcontentsmaski = CONTENTBITS_MONSTER;
PMoveCustom_RunPlayerPhysics(this);
SetOrigin(origin);
}

View file

@ -572,6 +572,9 @@ PMoveCustom_RunPlayerPhysics(entity target)
self.dimension_solid = 254;
self.dimension_hit = 254;
if (self.maxspeed <= 0)
self.maxspeed = 240;
/* call accelerate before and after the actual move,
* with half the move each time. this reduces framerate dependence.
* and makes controlling jumps slightly easier */