Fix /setspeedmod: apply per-character, persist across stat recalculation

Previously stomped the shared GServer->MOVE_SPEED_MOD movement-timing
divisor, which character.cpp's UpdatePosition also uses for monster position
interpolation -- GM testing broke movement/attack range server-wide until
restart. Now stores a per-character SpeedModPercent that GetMoveSpeed()
applies on every recompute, so it survives future SetStats() calls instead
of being silently overwritten back to base speed. Also fixes Mspd_base (the
value actually broadcast to clients) never being set while WALKING.
This commit is contained in:
Thomas committed 2026-07-10 14:19:32 +02:00
1 parent 15e562cb04
commit 16dccc94f2
4 files changed
+28 -2

No files matched your search

+7
View File
@@ -1050,6 +1050,13 @@ unsigned int CPlayer::GetMoveSpeed( )
default:
break;
}
if(Stats->SpeedModPercent != 100)
mspeed = mspeed * Stats->SpeedModPercent / 100;
// Mspd_base (what actually gets broadcast to clients, e.g. worldpackets.cpp's
// 0x782) was previously only touched by the RUNNING/DRIVING branches above --
// WALKING/default left it stale, so speed changes never showed up client-side
// while walking. Mirror the final value unconditionally.
Stats->Mspd_base = mspeed;
return mspeed;
}