Page 1 of 1

Annoying bug when applying spawn protection

Posted: Wed Jul 09, 2008 10:09 am
by jkoder
Hello again,

I have added spawn protection (player starts with battle suit) to my mod and although it works fine
their is a problem around 50% of the time if you kill the player whilst he has the battle suit sometimes
it drops as a black box instead of the actual battle suit icon/graphic.

In g_client/client_spawn() I add the following

Code: Select all

client->ps.powerups[PW_BATTLESUIT] = 3000;
Should I be doing something else also? Like I say, this problem only occurs sometimes, often I can drop the battle suit and it displays fine.

Re: Annoying bug when applying spawn protection

Posted: Wed Jul 09, 2008 11:17 am
by ^misantropia^
You need to preload the battle suit assets on levels that don't natively have it. At the start of a level, call CG_RegisterItemVisuals() (cgame/cg_weapons.c) with the item number of the battle suit.

Re: Annoying bug when applying spawn protection

Posted: Wed Jul 09, 2008 12:21 pm
by jkoder
Thanks a lot Misantropia!

I'm sure glad you and some others are still around to help.