summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: bc73e6c)
raw | patch | inline | side by side (parent: bc73e6c)
author | Dmitry D. Chernov <blackdoomer@yandex.ru> | |
Sat, 15 Jul 2023 11:17:42 +0000 (21:17 +1000) | ||
committer | Dmitry D. Chernov <blackdoomer@yandex.ru> | |
Sat, 15 Jul 2023 11:17:42 +0000 (21:17 +1000) |
Let's trust the user. This also fixes frequent fallback names when selecting preset randomly.
src/game/g_player.pas | patch | blob | history |
diff --git a/src/game/g_player.pas b/src/game/g_player.pas
index cda360c1006e6ad066964625442ae568e12fac86..82ce13054db7fb141c6468f3c5b01b9c74c861d3 100644 (file)
--- a/src/game/g_player.pas
+++ b/src/game/g_player.pas
function g_Player_Get(UID: Word): TPlayer;
function g_Player_GetCount(): Byte;
function g_Player_GetStats(): TPlayerStatArray;
-function g_Player_ValidName(Name: String): Boolean;
+function g_Player_ExistingName(Name: String): Boolean;
function g_Player_CreateCorpse(Player: TPlayer): Integer;
procedure g_Player_CreateGibs(fX, fY: Integer; ModelName: String; fColor: TRGB);
procedure g_Player_CreateShell(fX, fY, dX, dY: Integer; T: Byte);
_name := '';
if BotNames <> nil then
for a := 0 to High(BotNames) do
- if g_Player_ValidName(BotNames[a]) then
+ if g_Player_ExistingName(BotNames[a]) then
begin
_name := BotNames[a];
Break;
// Èìÿ áîòà:
_name := BotList[num].name;
-// Çàíÿòî - âûáèðàåì ñëó÷àéíîå:
- if not g_Player_ValidName(_name) then
- repeat
- _name := Format('DFBOT%.2d', [Random(100)]);
- until g_Player_ValidName(_name);
// Ìîäåëü:
_model := BotList[num].model;
(y >= 0) and (y <= PLAYER_RECT.Height);
end;
-function g_Player_ValidName(Name: string): Boolean;
+function g_Player_ExistingName(Name: string): Boolean;
var
a: Integer;
begin