When you throw the grenade from the weapon file, and you create the 
grenade entity, you will get a pointer to that entity.

If you make a couple of Set/Get functions for that, when it gets thrown 
you can set the boolean through those functions.

You can read up about pointers/classes/polymorphism/inheritance/etc on 
google if you don't understand any of them.

Any more questions feel free to reply ;)


Yorg Kuijs wrote:
> Sorry I didn't answer for a while, got an reply elsewhere and tried that 
> and have been playing l4d demo.
> Since I didn't get any further I took a look again at the replies I got 
> from the list and got me thinking.
>
> Tom, you say make a bool into grenade_frag, but then there's know to set 
> the bool to true, cause there's nothing that indicates it was thrown in 
> the grenade_frag file.
>
> So I went thinking again, why can't I use the bool simply on the 
> throwgrenade functions in the weapon file, answer: cause it's only 
> called once.
> But think functions keep doing whatever is in the code right?
>
> so if I'm carefull to make sure it wont endlessly spawn grenades, could 
> I make it a think function that keeps checking if the grenade was thrown 
> yet(in similar ways that the detonate timer works?)
> Tom Leighton wrote:
>   
>> I assume thats a member variable of the weapon_frag class, so you would 
>> need an instance of that to access the variable.
>>
>> You could simply put another bool fThrewGrenade into grenade_frag and 
>> then set that when you throw the grenade?
>>   
>>     
>
> _______________________________________________
> To unsubscribe, edit your list preferences, or view the list archives, please 
> visit:
> http://list.valvesoftware.com/mailman/listinfo/hlcoders
>
>
>   

_______________________________________________
To unsubscribe, edit your list preferences, or view the list archives, please 
visit:
http://list.valvesoftware.com/mailman/listinfo/hlcoders

Reply via email to