_netname = "FLUFFY PINK keycard";
_colormod = '1 1 1';
- if (!self.netname) {
+ if (self.netname == "") {
objerror("item_key doesn't have a default name for this key and a custom one was not specified!");
remove(self);
return;
_model = "models/keys/key.md3";
} else if (self.itemkeys >= ITEM_KEY_BIT(3) && self.itemkeys <= ITEM_KEY_BIT(5)) {
_model = "models/keys/key.md3"; // FIXME: replace it by a keycard model!
- } else if (!self.model) {
+ } else if (self.model == "") {
objerror("item_key doesn't have a default model for this key and a custom one was not specified!");
remove(self);
return;
}
// set defailt netname
- if (!self.netname)
+ if (self.netname == "")
self.netname = _netname;
// set default colormod
self.colormod = _colormod;
// set default model
- if (!self.model)
+ if (self.model == "")
self.model = _model;
// set default pickup message
- if (!self.message)
+ if (self.message == "")
self.message = strzone(strcat("You've picked up the ", self.netname, "!"));
- if (!self.noise)
+ if (self.noise == "")
self.noise = "misc/itempickup.wav";
// save the name for later
}
// set unlocked message
- if (!self.message)
+ if (self.message == "")
self.message = "Unlocked!";
// set default unlock noise
- if (!self.noise) {
+ if (self.noise == "") {
if (self.sounds == 1)
self.noise = "misc/secret.wav";
else if (self.sounds == 2)
}
// set default use key sound
- if (!self.noise1)
+ if (self.noise1 == "")
self.noise1 = "misc/decreasevalue.wav";
// set closed sourd
- if (!self.noise2)
+ if (self.noise2 == "")
self.noise2 = "misc/talk.wav";
// delay between triggering message2 and trigger2
rgb = '1 0 0';
}
}
- if(!name)
- {
- print("Unknown powerup-marked item is wanting to respawn\n");
- localcmd(sprintf("prvm_edict server %d\n", num_for_edict(self)));
- }
if(name)
{
WaypointSprite_Spawn(name, 0, 0, self, '0 0 64', world, 0, self, waypointsprite_attached, TRUE, RADARICON_POWERUP, rgb);
if(self.waypointsprite_attached)
WaypointSprite_UpdateBuildFinished(self.waypointsprite_attached, time + ITEM_RESPAWN_TICKS);
}
+ else
+ {
+ print("Unknown powerup-marked item is wanting to respawn\n");
+ localcmd(sprintf("prvm_edict server %d\n", num_for_edict(self)));
+ }
}
sound (self, CH_TRIGGER, "misc/itemrespawncountdown.wav", VOL_BASE, ATTN_NORM); // play respawn sound
if(self.waypointsprite_attached)
if(self.spawnflags & 4)
self.dmg = 10000;
- if(self.dmg && (!self.message))
+ if(self.dmg && (self.message == ""))
self.message = "was squished";
- if(self.dmg && (!self.message2))
+ if(self.dmg && (self.message2 == ""))
self.message2 = "was squished by";
if (self.sounds == 1)
targ = find(world, targetname, self.target);
self.enemy = targ;
self.target = targ.target;
- if (!self.target)
+ if (self.target == "")
objerror("train_next: no next target");
self.wait = targ.wait;
if (!self.wait)
entity targ;
targ = find(world, targetname, self.target);
self.target = targ.target;
- if (!self.target)
+ if (self.target == "")
objerror("func_train_find: no next target");
setorigin(self, targ.origin - self.mins);
self.nextthink = self.ltime + 1;
if (self.noise != "")
precache_sound(self.noise);
- if (!self.target)
+ if (self.target == "")
objerror("func_train without a target");
if (!self.speed)
self.speed = 100;
InitializeEntity(self, func_train_find, INITPRIO_SETLOCATION);
self.blocked = generic_plat_blocked;
- if(self.dmg & (!self.message))
+ if(self.dmg && (self.message == ""))
self.message = " was squished";
- if(self.dmg && (!self.message2))
+ if(self.dmg && (self.message2 == ""))
self.message2 = "was squished by";
if(self.dmg && (!self.dmgtime))
self.dmgtime = 0.25;
self.pos1 = self.avelocity;
- if(self.dmg & (!self.message))
+ if(self.dmg && (self.message == ""))
self.message = " was squished";
- if(self.dmg && (!self.message2))
+ if(self.dmg && (self.message2 == ""))
self.message2 = "was squished by";
// damage when blocked
self.blocked = generic_plat_blocked;
- if(self.dmg & (!self.message))
+ if(self.dmg && (self.message == ""))
self.message = " was squished";
- if(self.dmg && (!self.message2))
+ if(self.dmg && (self.message2 == ""))
self.message2 = "was squished by";
if(self.dmg && (!self.dmgtime))
self.dmgtime = 0.25;
self.speed = 30;
// not initializing self.dmg to 2, to allow damageless pendulum
- if(self.dmg & (!self.message))
+ if(self.dmg && (self.message == ""))
self.message = " was squished";
- if(self.dmg && (!self.message2))
+ if(self.dmg && (self.message2 == ""))
self.message2 = "was squished by";
if(self.dmg && (!self.dmgtime))
self.dmgtime = 0.25;
{
if(t.health && !self.health)
self.health = t.health;
- if(t.targetname && !self.targetname)
+ if((t.targetname != "") && (self.targetname == ""))
self.targetname = t.targetname;
- if(t.message != "" && self.message == "")
+ if((t.message != "") && (self.message == ""))
self.message = t.message;
if (t.absmin_x < cmins_x)
cmins_x = t.absmin_x;
// if(self.spawnflags & 8)
// self.dmg = 10000;
- if(self.dmg && (!self.message))
+ if(self.dmg && (self.message == ""))
self.message = "was squished";
- if(self.dmg && (!self.message2))
+ if(self.dmg && (self.message2 == ""))
self.message2 = "was squished by";
if (self.sounds > 0)
if(self.spawnflags & 8)
self.dmg = 10000;
- if(self.dmg && (!self.message))
+ if(self.dmg && (self.message == ""))
self.message = "was squished";
- if(self.dmg && (!self.message2))
+ if(self.dmg && (self.message2 == ""))
self.message2 = "was squished by";
if (self.sounds > 0)
self.cnt = 360 / self.speed;
self.blocked = generic_plat_blocked;
- if(self.dmg & (!self.message))
+ if(self.dmg && (self.message == ""))
self.message = " was squished";
- if(self.dmg && (!self.message2))
+ if(self.dmg && (self.message2 == ""))
self.message2 = "was squished by";
if(self.dmg && (!self.dmgtime))
self.dmgtime = 0.25;
self.target4normal = normalize(self.target4normal);
self.blocked = generic_plat_blocked;
- if(self.dmg & (!self.message))
+ if(self.dmg && (self.message == ""))
self.message = " was squished";
- if(self.dmg && (!self.message2))
+ if(self.dmg && (self.message == ""))
self.message2 = "was squished by";
if(self.dmg && (!self.dmgtime))
self.dmgtime = 0.25;