From b8f6d41418982163965dd5beb0b39dbdce1fbe8f Mon Sep 17 00:00:00 2001 From: truelight Date: Sat, 4 Dec 2004 17:54:56 +0000 Subject: (svn r942) -Merged branch/network back into the trunk --- vehicle.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'vehicle.c') diff --git a/vehicle.c b/vehicle.c index 9c46bb13b..4a895fe9b 100644 --- a/vehicle.c +++ b/vehicle.c @@ -1069,6 +1069,12 @@ static const byte * const _effecttick9_data[6] = { static void EffectTick_9(Vehicle *v) { + /* + * Warning: those effects can NOT use Random(), and have to use + * InteractiveRandom(), because somehow someone forgot to save + * spritenum to the savegame, and so it will cause desyncs in + * multiplayer!! (that is: in ToyLand) + */ int et; const byte *b; @@ -1086,7 +1092,7 @@ static void EffectTick_9(Vehicle *v) return; } if (v->u.special.unk2 != 0) { - v->spritenum = (byte)((Random()&3)+1); + v->spritenum = (byte)((InteractiveRandom()&3)+1); } else { v->spritenum = 6; } @@ -1104,7 +1110,7 @@ again: } if (*b == 0x81) { - if (v->z_pos > 180 || CHANCE16(1,96)) { + if (v->z_pos > 180 || CHANCE16I(1,96, InteractiveRandom())) { v->spritenum = 5; SndPlayVehicleFx(SND_2F_POP, v); } @@ -1399,7 +1405,7 @@ int32 CmdNameVehicle(int x, int y, uint32 flags, uint32 p1, uint32 p2) if (!CheckOwnership(v->owner)) return CMD_ERROR; - str = AllocateName((byte*)_decode_parameters, 2); + str = AllocateNameUnique((byte*)_decode_parameters, 2); if (str == 0) return CMD_ERROR; -- cgit v1.2.3-54-g00ecf