DEADSOFTWARE

BUG|HACK|INVESTIGATE: don't crash on removing invalid item id (seems that something...
authorKetmar Dark <ketmar@ketmar.no-ip.org>
Mon, 5 Feb 2018 00:51:45 +0000 (02:51 +0200)
committerKetmar Dark <ketmar@ketmar.no-ip.org>
Mon, 5 Feb 2018 00:52:28 +0000 (02:52 +0200)
src/game/g_items.pas

index 028f9d0a86024e5c6b8343c6f45e98429228467c..64ffe3e62697d8ac162de5f236987561ca2068c5 100644 (file)
@@ -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');