From: Ketmar Dark Date: Mon, 5 Feb 2018 00:51:45 +0000 (+0200) Subject: BUG|HACK|INVESTIGATE: don't crash on removing invalid item id (seems that something... X-Git-Url: http://deadsoftware.ru/gitweb?a=commitdiff_plain;h=ce76cc68a2b2daeb019a21940d9802610a55a281;p=d2df-sdl.git BUG|HACK|INVESTIGATE: don't crash on removing invalid item id (seems that something holds stale ids) --- diff --git a/src/game/g_items.pas b/src/game/g_items.pas index 028f9d0..64ffe3e 100644 --- a/src/game/g_items.pas +++ b/src/game/g_items.pas @@ -699,7 +699,12 @@ var it: PItem; trig: Integer; begin - if not g_Items_ValidId(ID) then raise Exception.Create('g_Items_Remove: invalid item id'); + if not g_Items_ValidId(ID) then + begin + //raise Exception.Create('g_Items_Remove: invalid item id'); + writeln('g_Items_Remove: invalid item id: ', ID); + exit; + end; it := @ggItems[ID]; if (it.arrIdx <> Integer(ID)) then raise Exception.Create('g_Items_Remove: arrIdx desync');