Annoying bug when applying spawn protection

Locked
jkoder
Posts: 59
Joined: Tue Jun 17, 2008 9:10 pm

Annoying bug when applying spawn protection

Post 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.
^misantropia^
Posts: 4022
Joined: Sat Mar 12, 2005 6:24 pm

Re: Annoying bug when applying spawn protection

Post 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.
jkoder
Posts: 59
Joined: Tue Jun 17, 2008 9:10 pm

Re: Annoying bug when applying spawn protection

Post by jkoder »

Thanks a lot Misantropia!

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