From cb833d3a196fdeb48111bed7a707e813924a4371 Mon Sep 17 00:00:00 2001 From: MirceaKitsune Date: Mon, 18 Jul 2011 14:10:05 +0300 Subject: [PATCH] Fix how weight is calculated and applied --- data/qcsrc/server/bot/havocbot/vore_ai.qc | 4 ++-- data/qcsrc/server/cl_physics.qc | 2 +- data/qcsrc/server/vore.qc | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/data/qcsrc/server/bot/havocbot/vore_ai.qc b/data/qcsrc/server/bot/havocbot/vore_ai.qc index c3d1c1bd..7c35ff94 100644 --- a/data/qcsrc/server/bot/havocbot/vore_ai.qc +++ b/data/qcsrc/server/bot/havocbot/vore_ai.qc @@ -141,9 +141,9 @@ void Vore_AI() if(!cvar("g_vore_reversescoring")) // when reverse scoring is on, it's in the interest of the prey to get eaten, so the predator has nothing to fear { if(skill >= 3) // make bots aware of this from skill 3 and up - fear *= 1 + self.stomach_maxload / self.stomach_load; // the bigger our stomach, the less we want to put someone else in there + fear *= 1 + self.stomach_load / self.stomach_maxload; // the bigger our stomach, the less we want to put someone else in there if(skill >= 5) // make bots aware of this from skill 5 and up - fear *= 1 + prey.stomach_maxload / prey.stomach_load; // predators fear prey that have a large stomach + fear *= 1 + prey.stomach_load / prey.stomach_maxload; // predators fear prey that have a large stomach if(cvar("g_healthsize")) fear *= (prey.scale / self.scale); // predators fear larger prey and are courageous toward smaller prey diff --git a/data/qcsrc/server/cl_physics.qc b/data/qcsrc/server/cl_physics.qc index e3dbb61a..ba186cbb 100644 --- a/data/qcsrc/server/cl_physics.qc +++ b/data/qcsrc/server/cl_physics.qc @@ -508,7 +508,7 @@ void PM_Accelerate(vector wishdir, float wishspeed, float wishspeed0, float acce accelqw = -accelqw; if(cvar("g_balance_vore_load_pred_weight") > 0) // apply stomach weight - wishspeed *= 1 - bound(0, self.stomach_maxload / self.stomach_load * cvar("g_balance_vore_load_pred_speed"), 1); + wishspeed *= 1 - bound(0, self.stomach_load / self.stomach_maxload * cvar("g_balance_vore_load_pred_speed"), 1); if(cvar("g_healthsize")) // if we are smaller or larger, we run slower or faster wishspeed *= (1 - cvar("g_healthsize_movementfactor")) + cvar("g_healthsize_movementfactor") * self.scale; if(self.swallow_progress_prey) // cut speed based on swallow progress for prey diff --git a/data/qcsrc/server/vore.qc b/data/qcsrc/server/vore.qc index a683fc65..b8c84850 100644 --- a/data/qcsrc/server/vore.qc +++ b/data/qcsrc/server/vore.qc @@ -40,7 +40,7 @@ float Swallow_condition_check(entity prey) if(prey.classname == "player" && !prey.stat_eaten && prey.deadflag == DEAD_NO) // we can't swallow someone who's already in someone else's stomach if(self.classname == "player" && !self.stat_eaten && self.deadflag == DEAD_NO) // we can't swallow players while inside someone's stomach ourselves if(!self.BUTTON_REGURGITATE && time > self.action_delay) - if not(vlen(self.velocity) > cvar("g_balance_vore_load_pred_speedcap") / (1 + self.stomach_load)) + if not(vlen(self.velocity) > cvar("g_balance_vore_load_pred_speedcap") / (self.stomach_maxload / self.stomach_load)) { string swallow_complain; if(teams_matter && prey.team == self.team && !cvar("g_vore_teamvore")) @@ -191,7 +191,7 @@ void Vore_WeightApply(entity e) // slowing the player is done in cl_physics.qc if(e.stomach_load != e.vore_oldstomachload) - e.gravity += 1 + (e.stomach_maxload / e.stomach_load * cvar("g_balance_vore_load_pred_weight") - e.vore_oldstomachload); + e.gravity += 1 + (e.stomach_load / e.stomach_maxload * cvar("g_balance_vore_load_pred_weight") - e.vore_oldstomachload); if(e.gravity == 0) e.gravity = 0.00001; // 0 becomes 1 for gravity, so do this to allow 0 gravity e.vore_oldstomachload = e.stomach_load; @@ -883,7 +883,7 @@ void Vore() if(self.predator.deadflag != DEAD_NO) Vore_Regurgitate(self); - else if(vlen(self.predator.velocity) > cvar("g_balance_vore_load_pred_speedcap") / (1 + self.predator.stomach_load)) + else if(vlen(self.predator.velocity) > cvar("g_balance_vore_load_pred_speedcap") / (self.stomach_maxload / self.stomach_load)) Vore_Regurgitate(self); // apply delayed regurgitating if it was scheduled -- 2.39.2