X-Git-Url: http://deadsoftware.ru/gitweb?a=blobdiff_plain;f=src%2Fgame%2Fg_netmsg.pas;h=2652bc504353f4e057043d14897383c45be50a0b;hb=8eceec602ff7e4107e330a44a3cea2067b4ce327;hp=39a4023d68a194a0eb30cc458f9572466a3383ed;hpb=b8b3691f5a4d6537539f557588cfd6fab79ed4b6;p=d2df-sdl.git diff --git a/src/game/g_netmsg.pas b/src/game/g_netmsg.pas index 39a4023..2652bc5 100644 --- a/src/game/g_netmsg.pas +++ b/src/game/g_netmsg.pas @@ -181,7 +181,7 @@ procedure MH_SEND_ItemSpawn(Quiet: Boolean; IID: Word; ID: Integer = NET_EVERYON procedure MH_SEND_ItemDestroy(Quiet: Boolean; IID: Word; ID: Integer = NET_EVERYONE); procedure MH_SEND_ItemPos(IID: Word; ID: Integer = NET_EVERYONE); // PANEL -procedure MH_SEND_PanelTexture(PGUID: Integer; AnimLoop: Byte; ID: Integer = NET_EVERYONE); +procedure MH_SEND_PanelTexture(PGUID: Integer; ID: Integer = NET_EVERYONE); procedure MH_SEND_PanelState(PGUID: Integer; ID: Integer = NET_EVERYONE); // MONSTER procedure MH_SEND_MonsterSpawn(UID: Word; ID: Integer = NET_EVERYONE); @@ -290,11 +290,17 @@ implementation {$IFDEF ENABLE_GFX} g_gfx, {$ENDIF} + {$IFDEF ENABLE_GIBS} + g_gibs, + {$ENDIF} {$IFDEF ENABLE_SHELLS} g_shells, {$ENDIF} + {$IFDEF ENABLE_CORPSES} + g_corpses, + {$ENDIF} Math, ENet, e_input, e_log, g_base, g_basic, - g_textures, g_sound, g_console, g_options, + g_sound, g_console, g_options, g_window, g_game, g_player, g_map, g_panel, g_items, g_weapons, g_phys, g_language, g_monsters, g_netmaster, utils, wadreader, MAPDEF ; @@ -910,7 +916,7 @@ procedure MH_SEND_Everything(CreatePlayers: Boolean {= False}; ID: Integer {= NE begin result := false; // don't stop MH_SEND_PanelState(pan.guid, ID); // anyway, to sync mplats - if (pan.CanChangeTexture) then MH_SEND_PanelTexture(pan.guid, pan.LastAnimLoop, ID); + if (pan.CanChangeTexture) then MH_SEND_PanelTexture(pan.guid, ID); end; var @@ -1479,22 +1485,18 @@ end; // PANEL -procedure MH_SEND_PanelTexture(PGUID: Integer; AnimLoop: Byte; ID: Integer = NET_EVERYONE); +procedure MH_SEND_PanelTexture(PGUID: Integer; ID: Integer = NET_EVERYONE); var TP: TPanel; begin TP := g_Map_PanelByGUID(PGUID); if (TP = nil) then exit; - with TP do - begin - NetOut.Write(Byte(NET_MSG_PTEX)); - NetOut.Write(LongWord(PGUID)); - NetOut.Write(FCurTexture); - NetOut.Write(FCurFrame); - NetOut.Write(FCurFrameCount); - NetOut.Write(AnimLoop); - end; + NetOut.Write(Byte(NET_MSG_PTEX)); + NetOut.Write(LongWord(PGUID)); + NetOut.Write(TP.FCurTexture); + NetOut.Write(TP.AnimTime); + NetOut.Write(TP.LastAnimLoop); g_Net_Host_Send(ID, True, NET_CHAN_LARGEDATA); end; @@ -2136,7 +2138,15 @@ begin NET_EV_LMS_START: begin - g_Player_RemoveAllCorpses; + {$IFDEF ENABLE_GIBS} + g_Gibs_RemoveAll; + {$ENDIF} + {$IFDEF ENALBE_SHELLS} + g_Shells_RemoveAll; + {$ENDIF} + {$IFDEF ENABLE_CORPSES} + g_Corpses_RemoveAll; + {$ENDIF} gLMSRespawn := LMS_RESPAWN_NONE; g_Game_Message(_lc[I_MESSAGE_LMS_START], 144); end; @@ -2809,18 +2819,13 @@ end; // PANEL procedure MC_RECV_PanelTexture(var M: TMsg); -var - TP: TPanel; - PGUID: Integer; - Tex, Fr: Integer; - Loop, Cnt: Byte; + var TP: TPanel; PGUID, Tex: Integer; AnimTime: LongWord; Loop: Byte; begin if not gGameOn then Exit; PGUID := Integer(M.ReadLongWord()); Tex := M.ReadLongInt(); - Fr := M.ReadLongInt(); - Cnt := M.ReadByte(); + AnimTime := M.ReadLongWord(); Loop := M.ReadByte(); TP := g_Map_PanelByGUID(PGUID); @@ -2828,7 +2833,7 @@ begin begin // switch texture TP.SetTexture(Tex, Loop); - TP.SetFrame(Fr, Cnt); + TP.SetFrame(AnimTime); end; end;