- other.itemkeys |= self.itemkeys;
- play2(other, self.noise);
+ other.itemkeys |= this.itemkeys;
+ play2(other, this.noise);
+
+ centerprint(other, this.message);
- centerprint(other, self.message);
+ string oldmsg = this.message;
+ this.message = "";
+ SUB_UseTargets(this, other, other); // TODO: should we be using other for the trigger here?
+ this.message = oldmsg;
- self.mdl = self.model;
- self.effects = EF_LOWPRECISION;
- _setmodel(self, self.model);
- //setsize(self, '-16 -16 -24', '16 16 32');
- setorigin(self, self.origin + '0 0 32');
- setsize(self, '-16 -16 -56', '16 16 0');
- self.modelflags |= MF_ROTATE;
- self.solid = SOLID_TRIGGER;
+ this.mdl = this.model;
+ this.effects = EF_LOWPRECISION;
+ _setmodel(this, this.model);
+ //setsize(this, '-16 -16 -24', '16 16 32');
+ setorigin(this, this.origin + '0 0 32');
+ setsize(this, '-16 -16 -56', '16 16 0');
+ this.modelflags |= MF_ROTATE;
+ this.solid = SOLID_TRIGGER;
- if (self.itemkeys>0 && (self.itemkeys & (self.itemkeys-1)) != 0) {
- objerror("item_key.itemkeys must contain only 1 bit set specifying the key it represents!");
- remove(self);
+ if (this.itemkeys>0 && (this.itemkeys & (this.itemkeys-1)) != 0) {
+ objerror(this, "item_key.itemkeys must contain only 1 bit set specifying the key it represents!");
+ remove(this);
- if (self.netname == "") {
- objerror("item_key doesn't have a default name for this key and a custom one was not specified!");
- remove(self);
+ if (this.netname == "") {
+ objerror(this, "item_key doesn't have a default name for this key and a custom one was not specified!");
+ remove(this);
- } 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);
+ } else if (this.model == "") {
+ objerror(this, "item_key doesn't have a default model for this key and a custom one was not specified!");
+ remove(this);
- if (self.message == "")
- self.message = strzone(strcat("You've picked up the ", self.netname, "!"));
+ if (this.message == "")
+ this.message = strzone(strcat("You've picked up the ", this.netname, "!"));
-void spawnfunc_item_key1(void)
-{SELFPARAM();
- self.classname = "item_key";
- self.itemkeys = ITEM_KEY_BIT(1);
- spawnfunc_item_key();
+spawnfunc(item_key1)
+{
+ this.classname = "item_key";
+ this.itemkeys = ITEM_KEY_BIT(1);
+ spawnfunc_item_key(this);
-void spawnfunc_item_key2(void)
-{SELFPARAM();
- self.classname = "item_key";
- self.itemkeys = ITEM_KEY_BIT(0);
- spawnfunc_item_key();
+spawnfunc(item_key2)
+{
+ this.classname = "item_key";
+ this.itemkeys = ITEM_KEY_BIT(0);
+ spawnfunc_item_key(this);