Xonotic QuakeC
The free, fast arena FPS with crisp movement and a wide array of weapons
levelwarp.qc
Go to the documentation of this file.
1#include "levelwarp.qh"
2
3#ifdef SVQC
4void target_levelwarp_use(entity this, entity actor, entity trigger)
5{
7 return; // only in campaign
8 if(this.active != ACTIVE_ACTIVE)
9 return;
10
11 if(this.cnt)
12 CampaignLevelWarp(this.cnt - 1); // specific level
13 else
14 CampaignLevelWarp(-1); // next level
15}
16
18{
19 this.active = ACTIVE_ACTIVE;
20}
21
22spawnfunc(target_levelwarp)
23{
24 // this.cnt is index (starting from 1) of the campaign level to warp to
25 // 0 means next level
27 this.active = ACTIVE_ACTIVE;
28 this.reset = target_levelwarp_reset;
29}
30#endif
var entity(vector mins, vector maxs,.entity tofield) findbox_tofield_OrFallback
float cnt
Definition powerups.qc:24
#define use
int active
Definition defs.qh:34
const int ACTIVE_ACTIVE
Definition defs.qh:37
void target_levelwarp_reset(entity this)
Definition levelwarp.qc:17
void target_levelwarp_use(entity this, entity actor, entity trigger)
Definition levelwarp.qc:4
bool autocvar_g_campaign
Definition menu.qc:747
void CampaignLevelWarp(float n)
Definition campaign.qc:261
#define spawnfunc(id)
Definition spawnfunc.qh:96