glob2-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [glob2-devel] I'm confused by the code in NewNicowar::control_attack


From: Bradley Arsenault
Subject: Re: [glob2-devel] I'm confused by the code in NewNicowar::control_attacks
Date: Sat, 11 Aug 2007 02:25:18 -0400

On 8/10/07, Joe Wells <address@hidden> wrote:
"Bradley Arsenault" <address@hidden> writes:

gdb says b is NULL after this command, so get_building is clearly
returning NULL.

Yes, its being given an invalid input somehow.
 

First, am I correct in understanding that b is actually supposed to be
an attack flag (not a real building)?

b is supposed to be an attack flag, because the I that is used to get_buildings comes from the vector attack_flags.
 

Is it always the case that the building register contains only attack
flags?  Otherwise why should entries 0, 1, 2, etc., be guaranteed to
be only attack flags and not also other buildings that are being
managed?

The difference between Echo and the actual game is that every building is given a unique ID for the entire game. Rather than the GID's, which can be re-used, the echo ID's are only used once for a building. I store those ID's in the vector attack_flags and retrieve them in this function. Somehow, the vector contains an ID for a flag that has already been destroyed. 0, 1, 2, and probably up to 20 are most likely normal buildings cause thats what nicowar constructs first, somewhere in there would be a couple exploration flags. A flag is a building the game engines perspective, except in a few special circumstances.
 

So b->locked[true] indicates whether the attack flag is accessible by
land *or* water, while b->locked[false] indicates whether it is
accessible by land only?  Right?

Yes.
 

For what it is worth, this happened when I had wiped out about 1/3 of
Nicowar's base area.  Would that cause Nicowar to delete one of its
attack flags in a strange way?

Hmm, it might have something to do with it, although doubtful. It might have removed the flag with that is_locked override right there since i've never actually seen nicowar do it in action (despite much hard testing)
 


Okay.

--
Joe


_______________________________________________
glob2-devel mailing list
address@hidden
http://lists.nongnu.org/mailman/listinfo/glob2-devel



--
Extra cheese comes at a cost. Bradley Arsenault.
reply via email to

[Prev in Thread] Current Thread [Next in Thread]