From: MirceaKitsune Date: Sun, 27 Feb 2011 16:04:15 +0000 (+0200) Subject: Small cleanups and comment changes X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=4714ccfa3e4d1659f1a3df28a78f9f4e0ceb956a;p=voretournament%2Fvoretournament.git Small cleanups and comment changes --- diff --git a/data/qcsrc/server/vore.qc b/data/qcsrc/server/vore.qc index f30e29a1..c9adc930 100644 --- a/data/qcsrc/server/vore.qc +++ b/data/qcsrc/server/vore.qc @@ -231,24 +231,25 @@ void Vore_DeadPrey_Configure(entity e) { // ran when the fulldigest feature is enabled and prey stays inside the stomach after dying - if(e.fakepredator.classname == "player" || e.predator.classname != "player") + if(e.fakepredator.classname == "player" || e.predator.classname != "player") // already configured return; - // this entity is pretty much like e.predator but for dead prey, to avoid some conflicts + // this entity is like e.predator but for dead prey, to avoid conflicts e.fakepredator = e.predator; - // first release the prey from the predator, as dead prey needs to be attached to predators differently - // the predator's stomach load is also decreased, as our dead prey doesn't count as actual prey any more + // first release the prey from the predator, as dead prey needs to be attached differently + // the predator's stomach load is also decreased, as dead prey doesn't count any more e.predator.stomach_load -= 1; Vore_Weight_apply(e.predator); e.predator = world; - // now, keep our dead prey inside the predator's stomach + // now put our dead prey inside the predator's stomach, but only as an effect e.movetype = MOVETYPE_FOLLOW; e.takedamage = DAMAGE_NO; e.solid = SOLID_NOT; e.aiment = e.fakepredator; - // completely hide the dead body + + // completely remove the dead body e.alpha = -1; setmodel(e, ""); } @@ -256,16 +257,26 @@ void Vore_DeadPrey_Configure(entity e) void Vore_DeadPrey_Detach(entity e) { // ran when dead prey must be detached from the stomach (eg: they are respawning) + // should only execute after Vore_DeadPrey_Configure has ran first + + if not(cvar("g_vore_fulldigest")) + return; e.fakepredator = world; e.aiment = world; } -void Vore_ChoosePreyRelease(entity e) +void Vore_PreyRelease(entity e) { - // if the fulldigest feature is on, we don't spit a dead prey's carcass out + // if the fulldigest feature is on, don't spit a dead prey's carcass out if(e.health <= 0 && cvar("g_vore_fulldigest")) + { Vore_DeadPrey_Configure(e); + + // if fulldigest is enabled and the predator is dead or disconnected, detach the dead prey from him + if(self.fakepredator.classname != "player" || self.fakepredator.deadflag != DEAD_NO) + Vore_DeadPrey_Detach(self); + } else Vore_Regurgitate(e); } @@ -276,7 +287,7 @@ void Vore_Disconnect() // prey disconnects or goes spectating while inside someone's belly if(self.predator.classname == "player") - Vore_ChoosePreyRelease(self); + Vore_PreyRelease(self); // pred disconnects or goes spectating with players in their belly else if(self.stomach_load > 0) @@ -285,7 +296,7 @@ void Vore_Disconnect() FOR_EACH_PLAYER(head) { if(head.predator == self) - Vore_ChoosePreyRelease(head); + Vore_PreyRelease(head); } Vore_Gurglesound(); // stop the gurgling sound } @@ -502,12 +513,7 @@ void Vore() if(self.deadflag) { - Vore_ChoosePreyRelease(self); - - // if the predator's dead, we detach the dead prey from him - if(self.fakepredator.classname != "player" || self.fakepredator.deadflag != DEAD_NO) - Vore_DeadPrey_Detach(self); - + Vore_PreyRelease(self); return; }