X-Git-Url: http://deadsoftware.ru/gitweb?a=blobdiff_plain;f=src%2Fgame%2Fg_player.pas;h=1468551a3c29fcd0ee26e32bc564ed7800559c2d;hb=86f970455d280f4e01f49bc5940222a805875425;hp=82ce13054db7fb141c6468f3c5b01b9c74c861d3;hpb=8769066a9aa4f618a3a508b5aaca284ae85545af;p=d2df-sdl.git diff --git a/src/game/g_player.pas b/src/game/g_player.pas index 82ce130..1468551 100644 --- a/src/game/g_player.pas +++ b/src/game/g_player.pas @@ -1116,6 +1116,13 @@ begin // Èìÿ áîòà: _name := BotList[num].name; + if (_name = '') and (BotNames <> nil) then + for a := 0 to High(BotNames) do + if g_Player_ExistingName(BotNames[a]) then + begin + _name := BotNames[a]; + Break; + end; // Ìîäåëü: _model := BotList[num].model; @@ -1126,7 +1133,10 @@ begin // Ñîçäàåì áîòà: with g_Player_Get(g_Player_Create(_model, BotList[num].color, Team, True)) as TBot do begin - Name := _name; + // Åñëè èìåíè íåò, äåëàåì åãî èç UID áîòà + if _name = '' + then Name := Format('DFBOT%.5d', [UID]) + else Name := _name; FDifficult.DiagFire := BotList[num].diag_fire; FDifficult.InvisFire := BotList[num].invis_fire; @@ -1261,12 +1271,17 @@ begin model := config.ReadStr(IntToStr(a), 'model', ''); // Ìîäåëü // Êîìàíäà - if config.ReadStr(IntToStr(a), 'team', 'red') = 'red' - then team := TEAM_RED - else team := TEAM_BLUE; + s := config.ReadStr(IntToStr(a), 'team', ''); + if s = 'red' then + team := TEAM_RED + else if s = 'blue' then + team := TEAM_BLUE + else + team := TEAM_NONE; // Öâåò ìîäåëè sa := parse(config.ReadStr(IntToStr(a), 'color', '')); + SetLength(sa, 3); color.R := StrToIntDef(sa[0], 0); color.G := StrToIntDef(sa[1], 0); color.B := StrToIntDef(sa[2], 0);