set g_pinata 0 "if set to 1 you will not only drop your current weapon when you are killed, but you will drop all weapons that you possessed"
set g_weapon_stay 0 "1: ghost weapons can be picked up too but give no ammo, 2: ghost weapons refill ammo to one pickup size, thrown guns have no ammo"
set g_weapon_throwable 1 "if set to 1, weapons can be dropped"
+set g_weapon_throw_lifetime 20 "time a dropped weapon should stay alive, -1 for infinite time"
set g_powerups -1 "if set to 0 the strength and shield (invincibility) will not spawn on the map, if 1 they will spawn in all game modes, -1 is game mode default"
set g_use_ammunition 1 "if set to 0 all weapons have unlimited ammunition"
set g_pickup_items -1 "if set to 0 all items (health, armor, ammo, weapons...) are removed from the map, if 1 they are forced to spawn"
bool autocvar_g_waypoints_for_items;
#define autocvar_g_weapon_stay cvar("g_weapon_stay")
bool autocvar_g_weapon_throwable;
+int autocvar_g_weapon_throw_lifetime;
#define autocvar_g_weaponarena cvar_string("g_weaponarena")
string autocvar_g_xonoticversion;
float autocvar_gameversion;
this.oldorigin = this.origin;
}
this.owner = NULL;
- float timeleft = this.savenextthink - time;
- if(timeleft > 1)
- SUB_SetFade(this, this.savenextthink - 1, 1);
- else if(timeleft > 0)
- SUB_SetFade(this, time, timeleft);
- else
- SUB_VanishOrRemove(this);
+ if ( autocvar_g_weapon_throw_lifetime >= 0 )
+ {
+ float timeleft = this.savenextthink - time;
+ if(timeleft > 1)
+ SUB_SetFade(this, this.savenextthink - 1, 1);
+ else if(timeleft > 0)
+ SUB_SetFade(this, time, timeleft);
+ else
+ SUB_VanishOrRemove(this);
+ }
}
// returns amount of ammo used as string, or -1 for failure, or 0 for no ammo count
if(startitem_failed)
return string_null;
setthink(wep, thrown_wep_think);
- wep.savenextthink = wep.nextthink;
+ wep.savenextthink = time + autocvar_g_weapon_throw_lifetime;
wep.nextthink = min(wep.nextthink, time + 0.5);
wep.pickup_anyway = true; // these are ALWAYS pickable