void kh_Key_Attach(entity key) // runs when a player picks up a key and several times when a key is assigned to a player at the start of a round
{
+ key.solid = SOLID_NOT; // before setorigin to prevent area grid linking
#ifdef KH_PLAYER_USE_ATTACHMENT
entity first = key.owner.kh_next;
if(key == first)
key.flags = 0;
if(IL_CONTAINS(g_items, key))
IL_REMOVE(g_items, key);
- key.solid = SOLID_NOT;
set_movetype(key, MOVETYPE_NONE);
key.team = key.owner.team;
key.nextthink = time;
void kh_Key_Detach(entity key) // runs every time a key is dropped or lost. Runs several times times when all the keys are captured
{
+ key.solid = SOLID_TRIGGER; // before setorigin to ensure area grid linking
#ifdef KH_PLAYER_USE_ATTACHMENT
entity first = key.owner.kh_next;
if(key == first)
key.flags = FL_ITEM;
if(!IL_CONTAINS(g_items, key))
IL_PUSH(g_items, key);
- key.solid = SOLID_TRIGGER;
set_movetype(key, MOVETYPE_TOSS);
key.pain_finished = time + autocvar_g_balance_keyhunt_delay_return;
key.damageforcescale = autocvar_g_balance_keyhunt_damageforcescale;