DEADSOFTWARE

render monster drop after monsters, so monster corpses will not obscure ammo clips...
[d2df-sdl.git] / src / game / g_monsters.pas
index 834220a1b40d316a4634bfc93f432739c077f860..1b39ee849607715154823fed3b6caf519667c925 100644 (file)
@@ -21,6 +21,7 @@ unit g_monsters;
 interface
 
 uses
+  mempool,
   g_basic, e_graphics, g_phys, g_textures, g_grid,
   g_saveload, BinEditor, g_panel, xprofiler;
 
@@ -48,7 +49,7 @@ const
 }
 
 type
-  TMonster = Class (TObject)
+  TMonster = class(TPoolObject)
   private
     FMonsterType: Byte;
     FUID: Word;
@@ -306,7 +307,7 @@ var
 implementation
 
 uses
-  e_log, g_main, g_sound, g_gfx, g_player, g_game,
+  e_log, e_texture, g_main, g_sound, g_gfx, g_player, g_game,
   g_weapons, g_triggers, MAPDEF, g_items, g_options,
   g_console, g_map, Math, SysUtils, g_menu, wadreader,
   g_language, g_netmsg, idpool;
@@ -2076,9 +2077,10 @@ begin
         it := g_Items_Create(FObj.X + (FObj.Rect.Width div 2),
                              FObj.Y + (FObj.Rect.Height div 2),
                              c, True, False);
+        g_Items_SetDrop(it); // mark it as monster drop
         g_Obj_Push(g_Items_ObjByIdx(it), (FObj.Vel.X div 2)-3+Random(7),
                                         (FObj.Vel.Y div 2)-Random(4));
-        positionChanged(); // this updates spatial accelerators
+        //positionChanged(); // this updates spatial accelerators
         if g_Game_IsServer and g_Game_IsNet then
           MH_SEND_ItemSpawn(True, it);
       end;