From: bones_was_here Date: Fri, 3 Nov 2023 16:43:17 +0000 (+1000) Subject: Monsters: always run at server ticrate X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=2466b0f6464d077e18b01df1ac2e42b5ec01caae;p=xonotic%2Fxonotic-data.pk3dir.git Monsters: always run at server ticrate --- diff --git a/monsters.cfg b/monsters.cfg index 7b85e76c9..d6e10751f 100644 --- a/monsters.cfg +++ b/monsters.cfg @@ -95,7 +95,6 @@ set g_monster_golem_speed_walk 150 // {{{ Misc set g_monsters 1 set g_monsters_edit 0 -set g_monsters_think_delay 0.03333 set g_monsters_skill 1 "Monster skill (affecting some of their attributes). 1 - easy, 2 - medium, 3 - hard, 4 - insane, 5 - nightmare" set g_monsters_miniboss_chance 5 set g_monsters_miniboss_healthboost 100 diff --git a/qcsrc/common/monsters/sv_monsters.qc b/qcsrc/common/monsters/sv_monsters.qc index 2371a4008..b71e1054d 100644 --- a/qcsrc/common/monsters/sv_monsters.qc +++ b/qcsrc/common/monsters/sv_monsters.qc @@ -943,7 +943,7 @@ void Monster_Remove(entity this) void Monster_Dead_Think(entity this) { - this.nextthink = time + this.ticrate; + this.nextthink = time; Monster mon = REGISTRY_GET(Monsters, this.monsterid); mon.mr_deadthink(mon, this); @@ -1252,7 +1252,7 @@ void Monster_Frozen_Think(entity this) { if (STAT(FROZEN, this) == FROZEN_TEMP_REVIVING) { - STAT(REVIVE_PROGRESS, this) = bound(0, STAT(REVIVE_PROGRESS, this) + this.ticrate * this.revive_speed, 1); + STAT(REVIVE_PROGRESS, this) = bound(0, STAT(REVIVE_PROGRESS, this) + frametime * this.revive_speed, 1); SetResourceExplicit(this, RES_HEALTH, max(1, STAT(REVIVE_PROGRESS, this) * this.max_health)); if (this.iceblock) this.iceblock.alpha = bound(0.2, 1 - STAT(REVIVE_PROGRESS, this), 1); @@ -1265,7 +1265,7 @@ void Monster_Frozen_Think(entity this) } else if (STAT(FROZEN, this) == FROZEN_TEMP_DYING) { - STAT(REVIVE_PROGRESS, this) = bound(0, STAT(REVIVE_PROGRESS, this) - this.ticrate * this.revive_speed, 1); + STAT(REVIVE_PROGRESS, this) = bound(0, STAT(REVIVE_PROGRESS, this) - frametime * this.revive_speed, 1); SetResourceExplicit(this, RES_HEALTH, max(0, autocvar_g_nades_ice_health + (this.max_health-autocvar_g_nades_ice_health) * STAT(REVIVE_PROGRESS, this))); if(!(this.spawnflags & MONSTERFLAG_INVINCIBLE) && this.sprite) @@ -1328,7 +1328,7 @@ void Monster_Enemy_Check(entity this) void Monster_Think(entity this) { setthink(this, Monster_Think); - this.nextthink = time + this.ticrate; + this.nextthink = time; if(this.monster_lifetime && time >= this.monster_lifetime) { @@ -1413,7 +1413,7 @@ bool Monster_Spawn_Setup(entity this) } setthink(this, Monster_Think); - this.nextthink = time + this.ticrate; + this.nextthink = time; if(MUTATOR_CALLHOOK(MonsterSpawn, this)) return false; @@ -1528,8 +1528,6 @@ bool Monster_Spawn(entity this, bool check_appear, Monster mon) setsize(this, RoundPerfectVector(mon.m_mins * this.scale), RoundPerfectVector(mon.m_maxs * this.scale)); this.view_ofs = '0 0 0.7' * (this.maxs_z * 0.5); - this.ticrate = bound(sys_frametime, ((!this.ticrate) ? autocvar_g_monsters_think_delay : this.ticrate), 60); - Monster_UpdateModel(this); if(!Monster_Spawn_Setup(this)) diff --git a/qcsrc/common/monsters/sv_monsters.qh b/qcsrc/common/monsters/sv_monsters.qh index 6a3fdd1c4..49c560e25 100644 --- a/qcsrc/common/monsters/sv_monsters.qh +++ b/qcsrc/common/monsters/sv_monsters.qh @@ -5,7 +5,6 @@ float autocvar_g_monsters; bool autocvar_g_monsters_edit; bool autocvar_g_monsters_sounds; -float autocvar_g_monsters_think_delay; int autocvar_g_monsters_max; int autocvar_g_monsters_max_perplayer; float autocvar_g_monsters_damageforcescale = 0.8;