FWGS / hlsdk-portable

Portable Half-Life SDK. GoldSource and Xash3D. Crossplatform.
https://xash.su
Other
266 stars 121 forks source link

[bot-10] respawn configured bots #422

Closed d47081 closed 8 months ago

d47081 commented 8 months ago

this patch allows to re-spawn same bots as configured, if they are not in use.

still testing on YGGverse server but looks it works well.

ps vscode have formatted empty lines, the fix in client.cpp only at line https://github.com/FWGS/hlsdk-portable/pull/422/commits/c786c8a4604a36651ff413347011ed9b417a0b90#diff-cf88165d4f283564472fca1bc224f90a38de2f8f0ed3232bf18b10c8959bf4d9R1370

d47081 commented 7 months ago

That's strange - it works but after some time bots strarting respawn with common names

image

like somewhere BotCreate still generating with default (null) values. Will check bot.cpp later, maybe the issue is there

And the max quantity of bots is 4, not 8.

Not sure that's related with PR.

d47081 commented 7 months ago

I think the reason of mix may be in missed meta update, like:

bot_respawn[index].state = BOT_IS_RESPAWNING;
bot_respawn[index].is_used = FALSE;      // free up this slot

or maybe statuses mismatch on the map change.