Game Development Community

flag.isHome not initialized

by Stefan Rampp · in General Discussion · 04/08/2003 (11:44 am) · 2 replies

I had the following problem with a ctf-map: when running over the own flag for the first time, being on team one/blue, I got the message "flag was returned by Team 1" (or something like that). However, the player didn't have any flag, since the mission just started. I had a look at the scripts and in flag.cs Flag::onPickup, the variable flag.isHome is tested. It turned out, that this variable is not initialized at the beginning of the match. After adding this to the mission file in the block where the flag item is declared, the problem disappeared.

Can somebody tell me, if this correction is itself correct? Is there another way to correct this problem? Maybe even a proper way to do it, and I misunderstood something?

Stefan.

#1
04/11/2003 (12:36 pm)
That is a fine way to correct it. When you run over the flag for the first time it should be initialized, but I guess that wasn't working.
#2
04/11/2003 (1:23 pm)
Thanks James!

I just had another look at the scripts and my mission file after read