X-Git-Url: http://deadsoftware.ru/gitweb?a=blobdiff_plain;f=src%2Fgame%2Fg_netmsg.pas;h=816673a180455a7289cd40b3332b97b40a39cad7;hb=e979719019322a78e7fded8fd96130c18cf31972;hp=0f57f84feeaf19f70148dae8ba60fcd250d53fe2;hpb=a64e75f513d36924da087b8d68d725918b2639f8;p=d2df-sdl.git diff --git a/src/game/g_netmsg.pas b/src/game/g_netmsg.pas index 0f57f84..816673a 100644 --- a/src/game/g_netmsg.pas +++ b/src/game/g_netmsg.pas @@ -276,9 +276,12 @@ function IsValidFilePath(const S: String): Boolean; implementation uses - Math, ENet, e_input, e_graphics, e_log, - g_textures, g_gfx, g_sound, g_console, g_basic, g_options, g_main, - g_game, g_player, g_map, g_panel, g_items, g_weapons, g_phys, g_gui, + {$IFNDEF HEADLESS} + g_gui, + {$ENDIF} + Math, ENet, e_input, e_log, g_base, g_basic, + g_textures, g_gfx, g_sound, g_console, g_options, + g_game, g_player, g_map, g_panel, g_items, g_weapons, g_phys, g_language, g_monsters, g_netmaster, utils, wadreader, MAPDEF; const @@ -650,7 +653,7 @@ begin Pl.Name := TmpName; end; - if TmpModel <> Pl.Model.Name then + if TmpModel <> Pl.Model.GetName() then Pl.SetModel(TmpModel); MH_SEND_PlayerSettings(Pl.UID, TmpModel); @@ -1242,7 +1245,7 @@ begin NetOut.Write(PID); NetOut.Write(Pl.Name); if Mdl = '' then - NetOut.Write(Pl.Model.Name) + NetOut.Write(Pl.Model.GetName()) else NetOut.Write(Mdl); NetOut.Write(Pl.FColor.R); @@ -1543,8 +1546,6 @@ var Kind: Byte; X, Y: Integer; Ang: SmallInt; - Anim: TAnimation; - ID: LongWord; begin if not gGameOn then Exit; Kind := M.ReadByte(); @@ -1558,72 +1559,40 @@ begin NET_GFX_TELE: begin - if g_Frames_Get(ID, 'FRAMES_TELEPORT') then - begin - Anim := TAnimation.Create(ID, False, 3); - g_GFX_OnceAnim(X, Y, Anim); - Anim.Free(); - end; + g_GFX_QueueEffect(R_GFX_TELEPORT_FAST, X, Y); if Ang = 1 then g_Sound_PlayExAt('SOUND_GAME_TELEPORT', X, Y); end; NET_GFX_EXPLODE: begin - if g_Frames_Get(ID, 'FRAMES_EXPLODE_ROCKET') then - begin - Anim := TAnimation.Create(ID, False, 6); - Anim.Blending := False; - g_GFX_OnceAnim(X-64, Y-64, Anim); - Anim.Free(); - end; + g_GFX_QueueEffect(R_GFX_EXPLODE_ROCKET, X - 64, Y - 64); if Ang = 1 then g_Sound_PlayExAt('SOUND_WEAPON_EXPLODEROCKET', X, Y); end; NET_GFX_BFGEXPL: begin - if g_Frames_Get(ID, 'FRAMES_EXPLODE_BFG') then - begin - Anim := TAnimation.Create(ID, False, 6); - Anim.Blending := False; - g_GFX_OnceAnim(X-64, Y-64, Anim); - Anim.Free(); - end; + g_GFX_QueueEffect(R_GFX_EXPLODE_BFG, X - 64, Y - 64); if Ang = 1 then g_Sound_PlayExAt('SOUND_WEAPON_EXPLODEBFG', X, Y); end; NET_GFX_BFGHIT: begin - if g_Frames_Get(ID, 'FRAMES_BFGHIT') then - begin - Anim := TAnimation.Create(ID, False, 4); - g_GFX_OnceAnim(X-32, Y-32, Anim); - Anim.Free(); - end; + g_GFX_QueueEffect(R_GFX_BFG_HIT, X - 32, Y - 32); end; NET_GFX_FIRE: begin - if g_Frames_Get(ID, 'FRAMES_FIRE') then - begin - Anim := TAnimation.Create(ID, False, 4); - g_GFX_OnceAnim(X, Y, Anim); - Anim.Free(); - end; + g_GFX_QueueEffect(R_GFX_FIRE, X, Y); if Ang = 1 then g_Sound_PlayExAt('SOUND_FIRE', X, Y); end; NET_GFX_RESPAWN: begin - if g_Frames_Get(ID, 'FRAMES_ITEM_RESPAWN') then - begin - Anim := TAnimation.Create(ID, False, 4); - g_GFX_OnceAnim(X, Y, Anim); - Anim.Free(); - end; + g_GFX_QueueEffect(R_GFX_ITEM_RESPAWN, X, Y); if Ang = 1 then g_Sound_PlayExAt('SOUND_ITEM_RESPAWNITEM', X, Y); end; @@ -2533,7 +2502,7 @@ begin Pl.Name := TmpName; end; - if TmpModel <> Pl.Model.Name then + if TmpModel <> Pl.Model.GetName() then Pl.SetModel(TmpModel); end; @@ -2542,11 +2511,9 @@ end; procedure MC_RECV_ItemSpawn(var M: TMsg); var ID: Word; - AID: DWord; X, Y, VX, VY: Integer; T: Byte; Quiet, Fall{, Resp}: Boolean; - Anim: TAnimation; it: PItem; begin if not gGameOn then Exit; @@ -2570,12 +2537,7 @@ begin if not Quiet then begin g_Sound_PlayExAt('SOUND_ITEM_RESPAWNITEM', X, Y); - if g_Frames_Get(AID, 'FRAMES_ITEM_RESPAWN') then - begin - Anim := TAnimation.Create(AID, False, 4); - g_GFX_OnceAnim(X+(it.Obj.Rect.Width div 2)-16, Y+(it.Obj.Rect.Height div 2)-16, Anim); - Anim.Free(); - end; + g_GFX_QueueEffect(R_GFX_ITEM_RESPAWN, X+(it.Obj.Rect.Width div 2)-16, Y+(it.Obj.Rect.Height div 2)-16); end; end; @@ -2981,7 +2943,11 @@ begin kByte := 0; Predict := NetPredictSelf; // and (not NetGotKeys); +{$IFDEF HEADLESS} + if (not gConsoleShow) and (not gChatShow) then +{$ELSE} if (not gConsoleShow) and (not gChatShow) and (g_ActiveWindow = nil) then +{$ENDIF} begin strafeDir := P1MoveButton shr 4; P1MoveButton := P1MoveButton and $0F;