add: yb_save_bots_names used to save bots names between level changes

remove: pfnChangLevel hook, it's not needed in multiplayer
remove: kick all bots on level change on xash3d, it's done by default now.
This commit is contained in:
dmitry 2021-09-21 16:52:20 +03:00
commit 49a1fbbb6b
No known key found for this signature in database
GPG key ID: 8297CE728B7A7E37
4 changed files with 25 additions and 26 deletions

View file

@ -339,10 +339,6 @@ CR_EXPORT int GetEntityAPI (gamefuncs_t *table, int) {
// send message on new map
util.setNeedForWelcome (false);
// xash is not kicking fakeclients on changelevel
if (game.is (GameFlags::Xash3D)) {
bots.kickEveryone (true, false);
}
graph.reset ();
// clear all the bots
@ -509,25 +505,6 @@ CR_LINKAGE_C int GetEngineFunctions (enginefuncs_t *table, int *) {
};
}
table->pfnChangeLevel = [] (char *s1, char *s2) {
// the purpose of this function is to ask the engine to shutdown the server and restart a
// new one running the map whose name is s1. It is used ONLY IN SINGLE PLAYER MODE and is
// transparent to the user, because it saves the player state and equipment and restores it
// back in the new level. The "changelevel trigger point" in the old level is linked to the
// new level's spawn point using the s2 string, which is formatted as follows: "trigger_name
// to spawnpoint_name", without spaces (for example, "tr_1atotr_2lm" would tell the engine
// the player has reached the trigger point "tr_1a" and has to spawn in the next level on the
// spawn point named "tr_2lm".
// save collected experience on map change
graph.savePractice ();
if (game.is (GameFlags::Metamod)) {
RETURN_META (MRES_IGNORED);
}
engfuncs.pfnChangeLevel (s1, s2);
};
table->pfnLightStyle = [] (int style, char *val) {
// ths function update lightstyle for the bots