write the tick the client writes

the leading vint of the game mode is not a field of its own. the client
loads it straight out of LogicTime at gameMode+0x60 and then encodes
LogicTime immediately after, so the same number goes out twice and the
two cannot drift. we kept a separate server_tick that the session never
advanced, so it stayed at zero while the clock ran - a divergence in the
checksum that had nothing to do with the simulation. the field is gone
and the tick comes from LogicTime.
This commit is contained in:
WiseDev 2026-08-23 13:47:34 +03:00
parent 438e2c6491
commit ade049b29d

View file

@ -8,7 +8,6 @@ pub const SECTION_BATTLE: i32 = 11;
pub const SECTION_TUTORIAL: i32 = 12;
#[derive(Debug, Default, Clone, PartialEq, Eq)]
pub struct LogicGameMode {
pub server_tick: i32,
pub time: LogicTime,
pub random: LogicRandom,
pub random_seed: i32,
@ -25,7 +24,7 @@ impl LogicGameMode {
}
impl LogicGameMode {
pub fn write(&self, writer: &mut ByteStreamWriter, with_commands: bool) -> Result<()> {
writer.write_vint(self.server_tick);
writer.write_vint(self.time.tick);
writer.write_checksum_checkpoint();
writer.write_vint(SECTION_BATTLE);
self.time.encode(writer)?;