From: MirceaKitsune Date: Thu, 7 Jul 2011 12:44:42 +0000 (+0300) Subject: Limit g_balance_vore_swallow_limit between 1 and 9. This fixes some small bugs, such... X-Git-Url: https://de.git.xonotic.org/?p=voretournament%2Fvoretournament.git;a=commitdiff_plain;h=e79a9bac1c149bc0f0488f33508007586a8cb9af Limit g_balance_vore_swallow_limit between 1 and 9. This fixes some small bugs, such as the scoreboard having to hide players it can no longer fit on the HUD. --- diff --git a/data/balanceVT.cfg b/data/balanceVT.cfg index 2c559e0a..083446b7 100644 --- a/data/balanceVT.cfg +++ b/data/balanceVT.cfg @@ -186,7 +186,7 @@ set g_balance_grabber_reload_time 2 // {{{ stomach set g_balance_vore_swallow_range 100 "distance below which you can swallow another player when facing them" -set g_balance_vore_swallow_limit 3 "how many players can fit inside a stomach (should not be greater than 3 due to the number of stomach state models for players)" +set g_balance_vore_swallow_limit 3 "how many players can fit in the stomach at a time, may range between 1 and 9" set g_balance_vore_swallow_stealprey 0.7 "probability of stealing someone's prey when eating them (when true their prey joins your stomach rather than popping out). 0 = never, 1 = always" set g_balance_vore_swallow_dropweapon 0.6 "probability of dropping your weapon when swallowed. 0 = never and 1 = always, does not apply to team mates" set g_balance_vore_swallow_punchangle 12 "your view gets tilted by this amount when swallowing someone" diff --git a/data/qcsrc/server/cl_client.qc b/data/qcsrc/server/cl_client.qc index edb58867..30629300 100644 --- a/data/qcsrc/server/cl_client.qc +++ b/data/qcsrc/server/cl_client.qc @@ -436,9 +436,9 @@ string setmodel_state() newmodel_extension = substring(self.playermodel, strlen(self.playermodel) - 4, 4); float vore_state; - if(self.stomach_load > ceil(cvar("g_balance_vore_swallow_limit") * 0.666666666666)) + if(self.stomach_load > ceil(g_balance_vore_swallow_limit * 0.666666666666)) vore_state = 3; - else if(self.stomach_load > ceil(cvar("g_balance_vore_swallow_limit") * 0.333333333333)) + else if(self.stomach_load > ceil(g_balance_vore_swallow_limit * 0.333333333333)) vore_state = 2; else if(self.stomach_load) vore_state = 1; @@ -1043,7 +1043,7 @@ float ClientInit_SendEntity(entity to, float sf) WriteByte(MSG_ENTITY, cvar("g_balance_weaponswitchdelay") * 255.0); WriteCoord(MSG_ENTITY, cvar("g_vore")); - WriteCoord(MSG_ENTITY, cvar("g_balance_vore_swallow_limit")); + WriteCoord(MSG_ENTITY, g_balance_vore_swallow_limit); return TRUE; } diff --git a/data/qcsrc/server/cl_player.qc b/data/qcsrc/server/cl_player.qc index bae973c7..430d6655 100644 --- a/data/qcsrc/server/cl_player.qc +++ b/data/qcsrc/server/cl_player.qc @@ -1336,7 +1336,7 @@ void GlobalSound(string sample, float chan, float voicetype) break; case VOICETYPE_GURGLE: if(self.stomach_load) - sound(self, chan, sample, VOL_BASE * self.stomach_load / cvar("g_balance_vore_swallow_limit"), ATTN_NORM); + sound(self, chan, sample, VOL_BASE * self.stomach_load / g_balance_vore_swallow_limit, ATTN_NORM); else stopsound(self, chan); break; diff --git a/data/qcsrc/server/defs.qh b/data/qcsrc/server/defs.qh index ba97835b..af3fa770 100644 --- a/data/qcsrc/server/defs.qh +++ b/data/qcsrc/server/defs.qh @@ -21,6 +21,7 @@ float ctf_score_value(string parameter); float g_dm, g_domination, g_ctf, g_tdm, g_keyhunt, g_onslaught, g_assault, g_arena, g_ca, g_lms, g_race, g_cts, g_rpg; float g_cloaked, g_footsteps, g_jump_grunt, g_midair, g_norecoil, g_vampire, g_bloodloss; +float g_balance_vore_swallow_limit; float g_warmup_limit; float g_warmup_allguns; float g_warmup_allow_timeout; diff --git a/data/qcsrc/server/miscfunctions.qc b/data/qcsrc/server/miscfunctions.qc index 30755d2c..3a053c19 100644 --- a/data/qcsrc/server/miscfunctions.qc +++ b/data/qcsrc/server/miscfunctions.qc @@ -1016,6 +1016,7 @@ void readlevelcvars(void) g_norecoil = cvar("g_norecoil"); g_vampire = cvar("g_vampire"); g_bloodloss = cvar("g_bloodloss"); + g_balance_vore_swallow_limit = bound(1, cvar("g_balance_vore_swallow_limit"), 9); // may only range between 1 and 9 sv_maxidle = cvar("sv_maxidle"); sv_maxidle_spectatorsareidle = cvar("sv_maxidle_spectatorsareidle"); sv_pogostick = cvar("sv_pogostick"); diff --git a/data/qcsrc/server/vore.qc b/data/qcsrc/server/vore.qc index 388c799a..0b0e01cd 100644 --- a/data/qcsrc/server/vore.qc +++ b/data/qcsrc/server/vore.qc @@ -43,8 +43,8 @@ float Swallow_condition_check(entity prey) swallow_complain = "You cannot swallow your team mates\n"; else if(!cvar("g_vore_spawnshield") && prey.spawnshieldtime > time) swallow_complain = "You cannot swallow someone protected by the spawn shield\n"; - else if(self.stomach_load >= cvar("g_balance_vore_swallow_limit")) - swallow_complain = strcat("You cannot swallow more than ^2", cvar_string("g_balance_vore_swallow_limit"), "^7 players at a time\n"); + else if(self.stomach_load >= g_balance_vore_swallow_limit) + swallow_complain = strcat("You cannot swallow more than ^2", ftos(g_balance_vore_swallow_limit), "^7 players at a time\n"); else if(cvar("g_vore_biggergut") && prey.stomach_load > self.stomach_load) swallow_complain = "You cannot swallow someone with a bigger stomach than yours\n"; else if(cvar("g_vore_biggersize") && prey.scale > self.scale)