summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: a924c87)
raw | patch | inline | side by side (parent: a924c87)
author | Challenge9 <letsgo9632@gmail.com> | |
Tue, 25 Apr 2023 16:25:40 +0000 (19:25 +0300) | ||
committer | TerminalHash <lyashuk.voxx@gmail.com> | |
Tue, 25 Apr 2023 17:48:33 +0000 (20:48 +0300) |
src/game/g_console.pas | patch | blob | history | |
src/game/g_game.pas | patch | blob | history | |
src/game/g_netmsg.pas | patch | blob | history | |
src/game/g_player.pas | patch | blob | history |
diff --git a/src/game/g_console.pas b/src/game/g_console.pas
index 7f1d7b2aab0894b1e8527e1d20e6a106c652bd90..53e8656b6ca39ccc2d027731b5e1e037a01afe6b 100644 (file)
--- a/src/game/g_console.pas
+++ b/src/game/g_console.pas
AddCommand('g_max_shells', GameCVars);
AddCommand('g_max_gibs', GameCVars);
AddCommand('g_max_corpses', GameCVars);
+ AddCommand('g_force_model', GameCVars);
+ AddCommand('g_force_model_name', GameCVars);
AddCommand('g_gamemode', GameCVars);
AddCommand('g_friendlyfire', GameCVars);
AddCommand('g_friendly_hit_trace', GameCVars);
WriteLn(f, 'g_max_shells ', g_Shells_GetMax());
WriteLn(f, 'g_max_gibs ', g_Gibs_GetMax());
WriteLn(f, 'g_max_corpses ', g_Corpses_GetMax());
+ WriteLn(f, 'g_force_model ', g_Force_Model_Get());
+ WriteLn(f, 'g_force_model_name ', g_Forced_Model_GetName());
WriteLn(f, 'sv_intertime ', gDefInterTime);
// gameplay settings
diff --git a/src/game/g_game.pas b/src/game/g_game.pas
index 7ec13174f02efdfb7d897b5d82a095f8c9dcc8e2..ebe014424a6183f8ae20d93dc30bb924f0d2a76f 100644 (file)
--- a/src/game/g_game.pas
+++ b/src/game/g_game.pas
e_LogWritefln('usage: %s <n>', [cmd])
end
end
+ else if cmd = 'g_force_model' then
+ begin
+ if Length(p) = 2 then
+ begin
+ a := StrToIntDef(p[1], 0);
+ g_Force_Model_Set(a);
+ end
+ end
+ else if cmd = 'g_force_model_name' then
+ begin
+ if (Length(P) > 1) then
+ begin
+ cmd := b_Text_Unformat(P[1]);
+ g_Forced_Model_SetName(cmd);
+ if (gGameSettings.GameType <> GT_SINGLE) and (g_Force_Model_Get() <> 0) and (gPlayers <> nil) then
+ begin
+ for a := Low(gPlayers) to High(gPlayers) do
+ begin
+ if (gPlayers[a] <> nil) then
+ begin
+ if (gPlayers[a].UID = gPlayer1.UID) then
+ continue
+ else if (gPlayer2 <> nil) and (gPlayers[a].UID = gPlayer2.UID) then
+ continue;
+ gPlayers[a].setModel(g_Forced_Model_GetName());
+ end;
+ end
+ end
+ end
+ end
else if cmd = 'g_scorelimit' then
begin
if Length(P) > 1 then
diff --git a/src/game/g_netmsg.pas b/src/game/g_netmsg.pas
index 1d63ec09505828e05b9ac9e6eeddf5c23bd5c01d..e41eafed8acafacaad3e23967d10eaf806db723d 100644 (file)
--- a/src/game/g_netmsg.pas
+++ b/src/game/g_netmsg.pas
SetWeaponPrefs(TmpPrefArray);
SwitchToEmpty := SwitchEmpty;
SkipFist := SkipF;
+ if (g_Force_Model_Get() <> 0) then
+ SetModel(g_Forced_Model_GetName());
Reset(True);
end;
Pl.Name := TmpName;
end;
+ if (g_Force_Model_Get() <> 0) then
+ TmpModel := g_Forced_Model_GetName();
if TmpModel <> Pl.Model.Name then
Pl.SetModel(TmpModel);
if (PID <> NetPlrUID1) and (PID <> NetPlrUID2) then
begin
if (Pl <> nil) then Exit;
+ if (g_Force_Model_Get() <> 0) then
+ Model := g_Forced_Model_GetName();
DID := g_Player_Create(Model, Color, T, False);
with g_Player_Get(DID) do
begin
var
TmpName: string;
TmpModel: string;
+ CheckModel: string;
TmpColor: TRGB;
TmpTeam: Byte;
Pl: TPlayer;
Pl.Name := TmpName;
end;
+ if (g_Force_Model_Get() <> 0) then
+ TmpModel := g_Forced_Model_GetName();
if TmpModel <> Pl.Model.Name then
Pl.SetModel(TmpModel);
end;
diff --git a/src/game/g_player.pas b/src/game/g_player.pas
index f926798cf4b4772defe298bbab189217006c474c..92e2902aa82105d0169cdc71664e1797e9f95906 100644 (file)
--- a/src/game/g_player.pas
+++ b/src/game/g_player.pas
function g_Gibs_GetMax(): Word;
procedure g_Corpses_SetMax(Count: Word);
function g_Corpses_GetMax(): Word;
+procedure g_Force_Model_Set(Mode: Word);
+function g_Force_Model_Get(): Word;
+procedure g_Forced_Model_SetName(Model: String);
+function g_Forced_Model_GetName(): String;
procedure g_Shells_SetMax(Count: Word);
function g_Shells_GetMax(): Word;
MaxGibs: Word = 150;
MaxCorpses: Word = 20;
MaxShells: Word = 300;
+ ForceModel: Word = 0;
+ ForcedModelName: String = STD_PLAYER_MODEL;
CurrentGib: Integer = 0;
CurrentShell: Integer = 0;
BotNames: Array of String;
Result := MaxCorpses;
end;
+procedure g_Force_Model_Set(Mode: Word);
+begin
+ ForceModel := Mode;
+end;
+
+function g_Force_Model_Get(): Word;
+begin
+ Result := ForceModel;
+end;
+
+procedure g_Forced_Model_SetName(Model: String);
+begin
+ ForcedModelName := Model;
+end;
+
+function g_Forced_Model_GetName(): String;
+begin
+ Result := ForcedModelName;
+end;
+
function g_Player_Create(ModelName: String; Color: TRGB; Team: Byte; Bot: Boolean): Word;
var
a: Integer;