Home » Stars! 2.6/7 » The Academy » Enemy SB can force two allyers to fight each other?
Re: Enemy SB can force two allyers to fight each other? |
Mon, 29 June 2009 09:43 |
|
magic9mushroom | | Commander | Messages: 1361
Registered: May 2008 | |
|
wasp wrote on Sat, 06 June 2009 02:58 |
XyliGUN wrote on Sat, 19 November 2005 05:00 | According to Starbase FAQ:Quote: | Another weird situation is that if race B shows up and everyone has set everyone to friend but your default order is to "attack everyone" (which matters for your starbase) than the two friends will shoot each other while your starbase (again none of your ships present) sits back and watches ...
|
There is a situation where SB can force two allyers to attack each other.
|
I think I have nailed this one down. Somewhere in the target selection algorithm ther must be code that looks something like
int who = battle_plans[starbase_owner][0].attack_who;
switch(who) {
case NOBODY:
break;
case ENEMIES:
case FRIENDS_ENEMIES:
/* skipped, these work correctly */
break;
case EVERYONE: /* BUG!! */
targets[fleet_owner] |= ~(1 << starbase_owner);
break;
default: /* BUG!! */
targets[fleet_owner] |= 1 << (who - 4);
}
fleet_owner is uninitialized at this point, and starbase_owner should be used instead. It appears that fleet_value usually contains a valid race number from a previous call to this function leading to the behaviour observed by Ptolemy.
However, in unfortunate cases
(for example, try it with every fleet in the galaxy in the same battle), fleet_owner is garbage, resulting in a buffer overrun and the game crashing or worse. Note that setting the default battle plan to either attack everyone or a single race will trigger this bug.
Luckily a small patch to the binary is enough to fix this. I put up a fixed version of JRC4 on my site.
|
Oh my, now that's dedication.
Be sure to tell the FreeStars people.
Report message to a moderator
|
|
|
|
|
Enemy SB can force two allyers to fight each other?
By: XyliGUN on Fri, 18 November 2005 22:00
|
|
|
Re: Enemy SB can force two allyers to fight each other?
By: Micha on Sat, 19 November 2005 04:24
|
|
|
Re: Enemy SB can force two allyers to fight each other?
By: XyliGUN on Sat, 19 November 2005 20:29
|
|
|
Re: Enemy SB can force two allyers to fight each other?
By: Ptolemy on Sun, 20 November 2005 03:09
|
|
|
Re: Enemy SB can force two allyers to fight each other?
By: Pote on Sun, 20 November 2005 13:56
|
|
|
Re: Enemy SB can force two allyers to fight each other?
By: Ptolemy on Sun, 20 November 2005 14:34
|
|
|
Re: Enemy SB can force two allyers to fight each other?
By: mlaub on Sun, 20 November 2005 18:26
|
|
|
Re: Enemy SB can force two allyers to fight each other?
By: XyliGUN on Mon, 21 November 2005 20:16
|
|
|
Re: Enemy SB can force two allyers to fight each other?
By: Ptolemy on Mon, 21 November 2005 22:19
|
|
|
Re: Enemy SB can force two allyers to fight each other?
By: Ptolemy on Mon, 21 November 2005 22:24
|
|
|
Re: Enemy SB can force two allyers to fight each other?
|
|
|
Re: Enemy SB can force two allyers to fight each other?
By: Ptolemy on Tue, 22 November 2005 14:14
|
|
|
Re: Enemy SB can force two allyers to fight each other?
By: Micha on Tue, 22 November 2005 14:22
|
|
|
Re: Enemy SB can force two allyers to fight each other?
By: XyliGUN on Tue, 22 November 2005 16:44
|
|
|
Re: Enemy SB can force two allyers to fight each other?
|
|
|
Re: Enemy SB can force two allyers to fight each other?
By: Ptolemy on Tue, 22 November 2005 21:06
|
|
|
Re: Enemy SB can force two allyers to fight each other?
By: Ptolemy on Tue, 22 November 2005 23:07
|
|
|
Re: Enemy SB can force two allyers to fight each other?
By: XyliGUN on Fri, 02 December 2005 19:38
|
|
|
Re: Enemy SB can force two allyers to fight each other?
By: Micha on Fri, 16 December 2005 04:10
|
|
|
Re: Enemy SB can force two allyers to fight each other?
By: crr65536 on Sun, 20 November 2005 21:09
|
|
|
Re: Enemy SB can force two allyers to fight each other?
|
|
|
Re: Enemy SB can force two allyers to fight each other?
By: Ptolemy on Mon, 21 November 2005 01:17
|
|
|
Re: Enemy SB can force two allyers to fight each other?
By: crr65536 on Mon, 21 November 2005 01:59
|
|
|
Re: Enemy SB can force two allyers to fight each other?
By: Ptolemy on Mon, 21 November 2005 10:29
|
|
|
Re: Enemy SB can force two allyers to fight each other?
By: crr65536 on Mon, 21 November 2005 11:53
|
|
|
Re: Enemy SB can force two allyers to fight each other?
|
|
|
Re: Enemy SB can force two allyers to fight each other?
By: Ptolemy on Mon, 21 November 2005 12:25
|
|
|
Re: Enemy SB can force two allyers to fight each other?
By: XyliGUN on Mon, 21 November 2005 12:26
|
|
|
Re: Enemy SB can force two allyers to fight each other?
By: XyliGUN on Mon, 21 November 2005 20:00
|
|
|
Re: Enemy SB can force two allyers to fight each other?
By: wasp on Fri, 05 June 2009 12:58
|
|
|
Re: Enemy SB can force two allyers to fight each other?
|
|
|
Re: Enemy SB can force two allyers to fight each other?
|
Goto Forum:
Current Time: Sun Jun 16 20:43:51 EDT 2024
|