From: TerminalHash Date: Mon, 28 Aug 2023 09:51:54 +0000 (+0300) Subject: game: move assists to another procedure block X-Git-Url: http://deadsoftware.ru/gitweb?a=commitdiff_plain;h=d791e7c0f4d07c19dd8d325c32b34aa9b32c51c4;p=d2df-sdl.git game: move assists to another procedure block and inc protocol version --- diff --git a/src/game/g_game.pas b/src/game/g_game.pas index 6a8d63c..9e7b4a2 100644 --- a/src/game/g_game.pas +++ b/src/game/g_game.pas @@ -1312,6 +1312,10 @@ begin e_TextureFontPrintEx(x+16, _y, s1, gStdFont, r, g, b, 1); e_TextureFontPrintEx(x+w1+16, _y, IntToStr(gTeamStat[a].Score), gStdFont, r, g, b, 1); + e_TextureFontPrintEx(x+w1+w2+16, _y, _lc[I_GAME_FRAGS], + gStdFont, r, g, b, 1); + e_TextureFontPrintEx(x+w1+w2+72, _y, _lc[I_GAME_ASSISTS], + gStdFont, r, g, b, 1); _y := _y+ch+(ch div 4); e_DrawLine(1, x+16, _y, x+w-16, _y, r, g, b); @@ -1344,7 +1348,7 @@ begin // Ôðàãè e_TextureFontPrintEx(x+w1+w2+16, _y, IntToStr(Frags), gStdFont, rr, gg, bb, 1); // Àññèñòû - e_TextureFontPrintEx(x+w1+w2+48, _y, IntToStr(Assists), gStdFont, rr, gg, bb, 1); + e_TextureFontPrintEx(x+w1+w2+72, _y, IntToStr(Assists), gStdFont, rr, gg, bb, 1); // Ñìåðòè e_TextureFontPrintEx(x+w1+w2+w3+16, _y, IntToStr(Deaths), gStdFont, rr, gg, bb, 1); _y := _y+ch; diff --git a/src/game/g_net.pas b/src/game/g_net.pas index 292f919..4013962 100644 --- a/src/game/g_net.pas +++ b/src/game/g_net.pas @@ -21,7 +21,7 @@ uses e_log, e_msg, utils, ENet, Classes, md5, MAPDEF{$IFDEF USE_MINIUPNPC}, miniupnpc;{$ELSE};{$ENDIF} const - NET_PROTOCOL_VER = 188; + NET_PROTOCOL_VER = 189; NET_MAXCLIENTS = 24; // NOTE: We use different channels for unreliable and reliable packets because ENet seems to diff --git a/src/game/g_player.pas b/src/game/g_player.pas index c903d13..4e5b60e 100644 --- a/src/game/g_player.pas +++ b/src/game/g_player.pas @@ -3439,7 +3439,6 @@ var plr: TPlayer; srv, netsrv: Boolean; DoFrags: Boolean; - DoAssists: Boolean; OldLR: Byte; KP: TPlayer; it: PItem; @@ -3477,7 +3476,6 @@ var begin DoFrags := (gGameSettings.MaxLives = 0) or (gGameSettings.GameMode = GM_COOP); - DoAssists := (gGameSettings.GameMode = GM_TDM) or (gGameSettings.GameMode = GM_CTF); Srv := g_Game_IsServer; Netsrv := g_Game_IsServer and g_Game_IsNet; if Srv then FDeath := FDeath + 1; @@ -3566,15 +3564,6 @@ begin KP.FragCombo(); end; - // Assists block - if (DoAssists or (gGameSettings.GameMode = GM_TDM)) then - begin - if a = 4 then - begin - Inc(KP.FAssists); - end; - end; - if (gGameSettings.GameMode = GM_TDM) and DoFrags then Inc(gTeamStat[KP.Team].Score, IfThen(SameTeam(FUID, SpawnerUID), -1, 1)); @@ -3861,6 +3850,23 @@ begin FNextWeapDelay := 0; end; +// Assists block +procedure TPlayer.Assist(); +var + DoAssists: Boolean; +begin + DoAssists := (gGameSettings.GameMode = GM_TDM) or (gGameSettings.GameMode = GM_CTF); + + if (DoAssists or (gGameSettings.GameMode = GM_TDM)) then + begin + if a = 4 then + begin + Inc(KP.FAssists); + end; + end; +end; + + function TPlayer.hasAmmoForWeapon (weapon: Byte): Boolean; begin result := false;