SERVER: Stop mglow$ from leaking MBOX ents

This commit is contained in:
cypress 2023-08-27 21:08:16 -04:00
parent 10418b38f7
commit ad23cd7933

View file

@ -1340,6 +1340,7 @@ void() findboxspot =
newspot.touch = mystery_touch;
newspot.solid=SOLID_TRIGGER;
newspot.classname = "mystery";
newspot.spawnflags = self.owner.spawnflags;
setorigin(newspot, newspot.origin);
setmodel (newspot, "models/machines/mystery.mdl");
newspot.frame = 0;
@ -1349,8 +1350,9 @@ void() findboxspot =
void() remove_box =
{
if (!(self.owner.spawnflags & MBOX_SPAWNFLAG_NOLIGHT))
if (self.owner.goaldummy != world)
setmodel(self.owner.goaldummy, "");
if (self.owner.goaldummy != world) {
MBOX_FreeEnt(self.owner.goaldummy);
}
self.owner.frame = 0; // set box frame
makevectors(self.angles);