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 committed 2015-04-30 17:19:00 -05:00
1 parent 8265af84be
commit 2292bf5bb2
1 file changed
+8 -4
+8 -4
View File
@@ -1100,7 +1100,8 @@ void BotWriteSessionData(bot_state_t *bs) {
"%i %i %i %i %i %i %i %i"
" %f %f %f"
" %f %f %f"
" %f %f %f",
" %f %f %f"
" %f",
bs->lastgoal_decisionmaker,
bs->lastgoal_ltgtype,
bs->lastgoal_teammate,
@@ -1117,7 +1118,8 @@ void BotWriteSessionData(bot_state_t *bs) {
bs->lastgoal_teamgoal.mins[2],
bs->lastgoal_teamgoal.maxs[0],
bs->lastgoal_teamgoal.maxs[1],
bs->lastgoal_teamgoal.maxs[2]
bs->lastgoal_teamgoal.maxs[2],
bs->formation_dist
);
var = va( "botsession%i", bs->client );
@@ -1141,7 +1143,8 @@ void BotReadSessionData(bot_state_t *bs) {
"%i %i %i %i %i %i %i %i"
" %f %f %f"
" %f %f %f"
" %f %f %f",
" %f %f %f"
" %f",
&bs->lastgoal_decisionmaker,
&bs->lastgoal_ltgtype,
&bs->lastgoal_teammate,
@@ -1158,7 +1161,8 @@ void BotReadSessionData(bot_state_t *bs) {
&bs->lastgoal_teamgoal.mins[2],
&bs->lastgoal_teamgoal.maxs[0],
&bs->lastgoal_teamgoal.maxs[1],
&bs->lastgoal_teamgoal.maxs[2]
&bs->lastgoal_teamgoal.maxs[2],
&bs->formation_dist
);
}