# HG changeset patch # User nemo # Date 1267018146 0 # Node ID 768dfbe276a59f528c292134d4b0b6a029745043 # Parent cc70797a0b75e934908490349194becb18c5622b Fix spectator crash due to missing nil check in new dust gear, init Ammo to nil in World prior to nil check diff -r cc70797a0b75 -r 768dfbe276a5 hedgewars/GSHandlers.inc --- a/hedgewars/GSHandlers.inc Wed Feb 24 03:03:43 2010 +0000 +++ b/hedgewars/GSHandlers.inc Wed Feb 24 13:29:06 2010 +0000 @@ -106,7 +106,7 @@ for i:= min(12, (3 + dmg div 10)) downto 0 do begin particle := AddVisualGear(hwRound(Gear^.X) - 5 + Random(10), hwRound(Gear^.Y) + 12, vgtDust); - particle^.dX := particle^.dX + (Gear^.dX / 5); + if particle <> nil then particle^.dX := particle^.dX + (Gear^.dX / 5); end; ApplyDamage(Gear, dmg); diff -r cc70797a0b75 -r 768dfbe276a5 hedgewars/uWorld.pas --- a/hedgewars/uWorld.pas Wed Feb 24 03:03:43 2010 +0000 +++ b/hedgewars/uWorld.pas Wed Feb 24 13:29:06 2010 +0000 @@ -139,6 +139,7 @@ else if AMxShift < 210 then inc(AMxShift, MENUSPEED); end; +Ammo:= nil; if (CurrentTeam <> nil) and (CurrentHedgehog <> nil) and (not CurrentTeam^.ExtDriven) and (CurrentHedgehog^.BotLevel = 0) then Ammo:= CurrentHedgehog^.Ammo else if (LocalAmmo <> -1) then