X-Git-Url: http://git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fcommon%2Fmapobjects%2Ffunc%2Fdoor.qc;h=3360fc961504b299b6d1f1c136c19439704f317a;hb=3fc2359b7933352424af07db8f84cbb9342e934f;hp=3aaf047a31a9b59e38c5aaeedc583c6a7097f7c8;hpb=2e05a1d8421ee2cbb604582d644133500aae2450;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/common/mapobjects/func/door.qc b/qcsrc/common/mapobjects/func/door.qc index 3aaf047a3..3360fc961 100644 --- a/qcsrc/common/mapobjects/func/door.qc +++ b/qcsrc/common/mapobjects/func/door.qc @@ -113,7 +113,7 @@ void door_go_down(entity this) if (this.max_health) { this.takedamage = DAMAGE_YES; - SetResourceAmount(this, RESOURCE_HEALTH, this.max_health); + SetResourceAmount(this, RES_HEALTH, this.max_health); } this.state = STATE_DOWN; @@ -265,7 +265,7 @@ void door_damage(entity this, entity inflictor, entity attacker, float damage, i if(this.spawnflags & NOSPLASH) if(!(DEATH_ISSPECIAL(deathtype)) && (deathtype & HITTYPE_SPLASH)) return; - TakeResource(this, RESOURCE_HEALTH, damage); + TakeResource(this, RES_HEALTH, damage); if (this.itemkeys) { @@ -273,9 +273,9 @@ void door_damage(entity this, entity inflictor, entity attacker, float damage, i return; } - if (GetResourceAmount(this, RESOURCE_HEALTH) <= 0) + if (GetResourceAmount(this, RES_HEALTH) <= 0) { - SetResourceAmount(this.owner, RESOURCE_HEALTH, this.owner.max_health); + SetResourceAmount(this.owner, RES_HEALTH, this.owner.max_health); this.owner.takedamage = DAMAGE_NO; // will be reset upon return door_use(this.owner, attacker, NULL); } @@ -357,7 +357,7 @@ Spawned if a door lacks a real activator void door_trigger_touch(entity this, entity toucher) { - if (GetResourceAmount(toucher, RESOURCE_HEALTH) < 1) + if (GetResourceAmount(toucher, RES_HEALTH) < 1) #ifdef SVQC if (!((toucher.iscreature || (toucher.flags & FL_PROJECTILE)) && !IS_DEAD(toucher))) #elif defined(CSQC) @@ -441,7 +441,7 @@ void LinkDoors(entity this) { this.owner = this.enemy = this; - if (GetResourceAmount(this, RESOURCE_HEALTH)) + if (GetResourceAmount(this, RES_HEALTH)) return; IFTARGETED return; @@ -474,8 +474,8 @@ void LinkDoors(entity this) cmaxs = this.absmax; for(t = this; ; t = t.enemy) { - if(GetResourceAmount(t, RESOURCE_HEALTH) && !GetResourceAmount(this, RESOURCE_HEALTH)) - SetResourceAmount(this, RESOURCE_HEALTH, GetResourceAmount(t, RESOURCE_HEALTH)); + if(GetResourceAmount(t, RES_HEALTH) && !GetResourceAmount(this, RES_HEALTH)) + SetResourceAmount(this, RES_HEALTH, GetResourceAmount(t, RES_HEALTH)); if((t.targetname != "") && (this.targetname == "")) this.targetname = t.targetname; if((t.message != "") && (this.message == "")) @@ -499,7 +499,7 @@ void LinkDoors(entity this) // distribute health, targetname, message for(t = this; t; t = t.enemy) { - SetResourceAmount(t, RESOURCE_HEALTH, GetResourceAmount(this, RESOURCE_HEALTH)); + SetResourceAmount(t, RES_HEALTH, GetResourceAmount(this, RES_HEALTH)); t.targetname = this.targetname; t.message = this.message; if(t.enemy == this) @@ -509,7 +509,7 @@ void LinkDoors(entity this) // shootable, or triggered doors just needed the owner/enemy links, // they don't spawn a field - if (GetResourceAmount(this, RESOURCE_HEALTH)) + if (GetResourceAmount(this, RES_HEALTH)) return; IFTARGETED return; @@ -628,7 +628,7 @@ void door_reset(entity this) // common code for func_door and func_door_rotating spawnfuncs void door_init_shared(entity this) { - this.max_health = GetResourceAmount(this, RESOURCE_HEALTH); + this.max_health = GetResourceAmount(this, RES_HEALTH); // unlock sound if(this.noise == "") @@ -681,7 +681,7 @@ void door_init_shared(entity this) this.state = STATE_BOTTOM; - if (GetResourceAmount(this, RESOURCE_HEALTH)) + if (GetResourceAmount(this, RES_HEALTH)) { //this.canteamdamage = true; // TODO this.takedamage = DAMAGE_YES;