Vanilla Netrek Server Development Archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[VANILLA-L:1067] Patch: Reset galaxy and INL robot
This patch changes the behavior of the INL robot so that it doesn't
reset the galaxy at the end of the game. I just added a flag to
reset_inl() that tells us if it's the end of the tourney or not. If
it's the end, then we don't reset.
This problem was originally reported in a list of things that needed
to be fixed with the robot. Reference vanilla-l:842.
-Jeff (specter)
*** /home/jeff/vanilla/8/base/Server/robots/inl.c Wed Apr 22 21:53:31 1998
--- ../Server/robots/inl.c Tue Jun 2 15:33:02 1998
***************
*** 93,99 ****
};
void cleanup();
! void reset_inl();
int checkmess();
void inlmove();
int end_tourney();
--- 93,99 ----
};
void cleanup();
! void reset_inl(int);
int checkmess();
void inlmove();
int end_tourney();
***************
*** 139,145 ****
pmessage(0, MALL, inl_from, "###############################");
init_server();
! reset_inl();
udt.it_interval.tv_sec = 0; /* Robots move PERSEC times/sec */
udt.it_interval.tv_usec = 1000000 / PERSEC;
--- 139,145 ----
pmessage(0, MALL, inl_from, "###############################");
init_server();
! reset_inl(0);
udt.it_interval.tv_sec = 0; /* Robots move PERSEC times/sec */
udt.it_interval.tv_usec = 1000000 / PERSEC;
***************
*** 449,455 ****
inl_teams[HOME].planets, inl_teams[AWAY].planets,
(20 - inl_teams[HOME].planets - inl_teams[AWAY].planets));
status->tourn = 0;
! reset_inl();
}
if (inl_stat.flags & S_TOURNEY)
--- 449,455 ----
inl_teams[HOME].planets, inl_teams[AWAY].planets,
(20 - inl_teams[HOME].planets - inl_teams[AWAY].planets));
status->tourn = 0;
! reset_inl(1);
}
if (inl_stat.flags & S_TOURNEY)
***************
*** 470,481 ****
pmessage(0, MALL, inl_from,
"------ Game ran out of time without a winner ------");
status->tourn = 0;
! reset_inl();
}
}
void
! reset_inl()
{
int c;
--- 470,483 ----
pmessage(0, MALL, inl_from,
"------ Game ran out of time without a winner ------");
status->tourn = 0;
! reset_inl(1);
}
}
void
! reset_inl(int is_end_tourney)
! /* is_end_tourney: boolean, used so that the galaxy isn't reset
! at the end of a tournament. */
{
int c;
***************
*** 529,540 ****
inl_teams[AWAY].planets = 10;
/* Set player queues back to standard starting teams */
! queues[QU_HOME].tournmask = FED;
! queues[QU_AWAY].tournmask = ROM;
! queues[QU_HOME_OBS].tournmask = FED;
! queues[QU_AWAY_OBS].tournmask = ROM;
! doResources(1);
obliterate(1, KSHIP);
--- 531,546 ----
inl_teams[AWAY].planets = 10;
/* Set player queues back to standard starting teams */
! if (!is_end_tourney) {
! queues[QU_HOME].tournmask = FED;
! queues[QU_AWAY].tournmask = ROM;
! queues[QU_HOME_OBS].tournmask = FED;
! queues[QU_AWAY_OBS].tournmask = ROM;
! }
! if (!is_end_tourney) {
! doResources(1);
! }
obliterate(1, KSHIP);
+
++ Vanilla-l Mailing List ++
To unsubscribe: send "unsubscribe vanilla-l" to majordomo@real-time.com
For more information: http://archives.real-time.com
Follow-Ups: