[airstrike] Level changing and tags

Erik Auerswald auerswal at unix-ag.uni-kl.de
Sun May 8 17:47:33 EDT 2005


Hi,

> When the problem appears of plane not being controllable
> (when advancing to the Doughnut Run level), I get these messages:
> ------
> Warning: generator tag 'p1plane' already defined.
> Loading level The Island
> ...
> Loading level The Pit
> ...
> Warning: Sprite tag 'p1plane' already defined.
> Error: No such sprite tag 'p1plane'.
> Loading level Doughnut Run
> -------
> 
> The warnings sound a bit funny, shouldn't the tags be cleared when level
> ends?  (so that I can re-use the same tag for a different purpose on
> a different level)

The warning is generated by line 38 of src/engine/sprite_types.c and the
corresponding sprite with tag is not defined. A (working) workaround is to
remove the tag (with objdict_remove_name()) and add it afterwards, but I
don't think this is intended.

As the sprite that was connected to the tag does not exist any more
(destroyed by objlist_killall(mech_group) in unload_level(), I assume)
the tag should be removed as well.

The problem seems to come from src/engine/level.c, function
level_unload(), lines 157 to 160. The sprite_tags thing is not reset
(neither removed nor cleaned) in this functions,
sprite_types_info_clear() in line 160 does nothing. If the sprite_tags
are cleaned (with objdict_clean(sprite_tags)) in the level_unlod()
function the bug is fixed. This might be the intended behaviour of
level_unload(), but I don't know this (especially if sprite_tags should
be cleaned or deleted and recreated...). 

As it is the code does not allow the reuse of a sprite tag in a later
level.

Erik



More information about the airstrike mailing list