Save bot accompany distance across map change or restart

If a bot is accompanying someone before map change or restart, the bot would
continue accompanying them but press up against them and orbit around them.
This is caused by the bot's formation distance being 0.

Save the formation distance so they maintain proper distance and do not
orbit around the player.
This commit is contained in:
Zack Middleton 2015-04-30 17:14:29 -05:00
parent 8265af84be
commit 2292bf5bb2

View file

@ -1100,7 +1100,8 @@ void BotWriteSessionData(bot_state_t *bs) {
"%i %i %i %i %i %i %i %i" "%i %i %i %i %i %i %i %i"
" %f %f %f" " %f %f %f"
" %f %f %f" " %f %f %f"
" %f %f %f", " %f %f %f"
" %f",
bs->lastgoal_decisionmaker, bs->lastgoal_decisionmaker,
bs->lastgoal_ltgtype, bs->lastgoal_ltgtype,
bs->lastgoal_teammate, bs->lastgoal_teammate,
@ -1117,7 +1118,8 @@ void BotWriteSessionData(bot_state_t *bs) {
bs->lastgoal_teamgoal.mins[2], bs->lastgoal_teamgoal.mins[2],
bs->lastgoal_teamgoal.maxs[0], bs->lastgoal_teamgoal.maxs[0],
bs->lastgoal_teamgoal.maxs[1], bs->lastgoal_teamgoal.maxs[1],
bs->lastgoal_teamgoal.maxs[2] bs->lastgoal_teamgoal.maxs[2],
bs->formation_dist
); );
var = va( "botsession%i", bs->client ); var = va( "botsession%i", bs->client );
@ -1141,7 +1143,8 @@ void BotReadSessionData(bot_state_t *bs) {
"%i %i %i %i %i %i %i %i" "%i %i %i %i %i %i %i %i"
" %f %f %f" " %f %f %f"
" %f %f %f" " %f %f %f"
" %f %f %f", " %f %f %f"
" %f",
&bs->lastgoal_decisionmaker, &bs->lastgoal_decisionmaker,
&bs->lastgoal_ltgtype, &bs->lastgoal_ltgtype,
&bs->lastgoal_teammate, &bs->lastgoal_teammate,
@ -1158,7 +1161,8 @@ void BotReadSessionData(bot_state_t *bs) {
&bs->lastgoal_teamgoal.mins[2], &bs->lastgoal_teamgoal.mins[2],
&bs->lastgoal_teamgoal.maxs[0], &bs->lastgoal_teamgoal.maxs[0],
&bs->lastgoal_teamgoal.maxs[1], &bs->lastgoal_teamgoal.maxs[1],
&bs->lastgoal_teamgoal.maxs[2] &bs->lastgoal_teamgoal.maxs[2],
&bs->formation_dist
); );
} }