--- deliantra/server/common/button.C 2007/07/31 18:28:46 1.38
+++ deliantra/server/common/button.C 2009/01/08 04:35:03 1.52
@@ -1,11 +1,11 @@
/*
- * This file is part of Crossfire TRT, the Roguelike Realtime MORPG.
+ * This file is part of Deliantra, the Roguelike Realtime MMORPG.
*
- * Copyright (©) 2005,2006,2007 Marc Alexander Lehmann / Robin Redeker / the Crossfire TRT team
+ * Copyright (©) 2005,2006,2007,2008 Marc Alexander Lehmann / Robin Redeker / the Deliantra team
* Copyright (©) 2002,2007 Mark Wedel & Crossfire Development Team
* Copyright (©) 1992,2007 Frank Tore Johansen
*
- * Crossfire TRT is free software: you can redistribute it and/or modify
+ * Deliantra is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
@@ -18,11 +18,10 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see .
*
- * The authors can be reached via e-mail to
+ * The authors can be reached via e-mail to
*/
#include
-#include
/*
* This code is no longer highly inefficient 8)
@@ -32,10 +31,11 @@
* elmex:
* This function takes a objectlink list with all the objects are going to be activated.
* state is a true/false flag that will actiavte objects that have FLAG_ACTIVATE_ON_PUSH/RELEASE set.
- * The source argument can be 0 or the source object for this activation.
+ * The activator argument can be 0 or the source object for this activation.
+ * the originator is the player or monster who did something.
*/
-void
-activate_connection_link (objectlink * ol, bool state, object *source = 0)
+static void
+activate_connection_link (objectlink *ol, bool state, object *activator, object *originator)
{
for (; ol; ol = ol->next)
{
@@ -69,6 +69,10 @@
{
case GATE:
case HOLE:
+ if (!tmp->active)
+ tmp->play_sound (tmp->sound
+ ? tmp->sound
+ : sound_find (tmp->type == GATE ? "trigger_gate" : "trigger_hole"));
tmp->value = tmp->stats.maxsp ? !state : state;
tmp->set_speed (0.5);
break;
@@ -81,7 +85,7 @@
case SIGN:
if (!tmp->stats.food || tmp->last_eat < tmp->stats.food)
{
- tmp->play_sound (tmp->sound);
+ tmp->play_sound (tmp->sound ? tmp->sound : sound_find ("trigger_sign"));
new_info_map (NDI_UNIQUE | NDI_NAVY, tmp->map, tmp->msg);
if (tmp->stats.food)
tmp->last_eat++;
@@ -89,6 +93,7 @@
break;
case ALTAR:
+ tmp->play_sound (tmp->sound ? tmp->sound : sound_find ("trigger_altar"));
tmp->value = 1;
SET_ANIMATION (tmp, tmp->value);
update_object (tmp, UP_OBJ_FACE);
@@ -96,16 +101,20 @@
case BUTTON:
case PEDESTAL:
+ tmp->play_sound (tmp->sound ? tmp->sound : sound_find ("trigger_button"));
tmp->value = state;
SET_ANIMATION (tmp, tmp->value);
update_object (tmp, UP_OBJ_FACE);
break;
case MOOD_FLOOR:
- do_mood_floor (tmp, source);
+ do_mood_floor (tmp, activator);
break;
case TIMED_GATE:
+ if (!tmp->active)
+ tmp->play_sound (tmp->sound ? tmp->sound : sound_find ("trigger_gate"));
+
tmp->set_speed (tmp->arch->speed);
tmp->value = tmp->arch->value;
tmp->stats.sp = 1;
@@ -144,12 +153,17 @@
break;
case TRIGGER_MARKER:
+ //tmp->play_sound (tmp->sound ? tmp->sound : sound_find ("trigger_marker"));
move_marker (tmp);
break;
case DUPLICATOR:
move_duplicator (tmp);
break;
+
+ case MAPSCRIPT:
+ cfperl_mapscript_activate (tmp, state, activator, originator);
+ break;
}
}
}
@@ -167,17 +181,15 @@
*
*/
void
-push_button (object *op)
+push_button (object *op, object *originator)
{
- oblinkpt *obp = get_button_links (op);
-
- if (!obp)
- return;
-
- if (INVOKE_MAP (TRIGGER, op->map, ARG_INT64 (obp->value), ARG_INT (op->value)))
- return;
+ if (oblinkpt *obp = op->find_link ())
+ {
+ if (INVOKE_MAP (TRIGGER, op->map, ARG_STRING (&obp->id), ARG_INT (op->value), ARG_OBJECT (op), ARG_OBJECT (originator)))
+ return;
- activate_connection_link (obp->link, op->value, op);
+ activate_connection_link (obp->link, op->value, op, originator);
+ }
}
/*
@@ -189,15 +201,13 @@
*
*/
void
-activate_connection (maptile *map, long connection, bool state)
+maptile::trigger (shstr_tmp id, bool state, object *activator, object *originator)
{
- if (INVOKE_MAP (TRIGGER, map, ARG_INT64 (connection), ARG_INT (state)))
+ if (INVOKE_MAP (TRIGGER, this, ARG_STRING (&id), ARG_INT (state), ARG_OBJECT (originator)))
return;
- oblinkpt *obp = get_connection_links (map, connection);
-
- if (obp)
- activate_connection_link (obp->link, state);
+ if (oblinkpt *obp = find_link (id))
+ activate_connection_link (obp->link, state, activator, originator);
}
/*
@@ -207,17 +217,12 @@
* button reacts to the (eventual) change of state.
*/
void
-update_button (object *op)
+update_button (object *op, object *originator)
{
- object *ab, *tmp, *head;
- int tot, any_down = 0, old_value = op->value;
- oblinkpt *obp = 0;
- objectlink *ol;
-
- obp = get_button_links (op);
- /* LOG(llevDebug, "update_button: %s (%d)\n", op->name, op->count); */
- if (obp)
- for (ol = obp->link; ol; ol = ol->next)
+ int any_down = 0, old_value = op->value;
+
+ if (oblinkpt *obp = op->find_link ())
+ for (objectlink *ol = obp->link; ol; ol = ol->next)
{
if (!ol->ob)
{
@@ -225,66 +230,67 @@
continue;
}
- tmp = ol->ob;
+ object *tmp = ol->ob;
+
if (tmp->type == BUTTON)
{
- for (ab = tmp->above, tot = 0; ab != NULL; ab = ab->above)
- /* Bug? The pedestal code below looks for the head of
- * the object, this bit doesn't. I'd think we should check
- * for head here also. Maybe it also makese sense to
- * make the for ab=tmp->above loop common, and alter
- * behaviour based on object within that loop?
- */
+ sint32 total = 0;
+ for (object *ab = tmp->above; ab; ab = ab->above)
/* Basically, if the move_type matches that on what the
- * button wants, we count it. The second check is so that
- * objects don't move (swords, etc) will count. Note that
+ * button wants, we count it. The second check is so that
+ * objects who don't move (swords, etc) will count. Note that
* this means that more work is needed to make buttons
* that are only triggered by flying objects.
*/
if ((ab->move_type & tmp->move_on) || ab->move_type == 0)
- tot += ab->weight * (ab->nrof ? ab->nrof : 1) + ab->carrying;
+ total += ab->head_ ()->total_weight ();
- tmp->value = (tot >= tmp->weight) ? 1 : 0;
- if (tmp->value)
- any_down = 1;
+ tmp->value = total >= tmp->weight;
+
+ any_down = any_down || tmp->value;
}
else if (tmp->type == PEDESTAL)
{
tmp->value = 0;
- for (ab = tmp->above; ab != NULL; ab = ab->above)
+
+ for (object *ab = tmp->above; ab; ab = ab->above)
{
- head = ab->head_ ();
+ object *head = ab->head_ ();
+
/* Same note regarding move_type for buttons above apply here. */
- if (((head->move_type & tmp->move_on) || ab->move_type == 0) &&
- (head->race == tmp->slaying ||
- ((head->type == SPECIAL_KEY) && (head->slaying == tmp->slaying)) ||
- (!strcmp (tmp->slaying, "player") && head->type == PLAYER)))
+ if (((ab->move_type & tmp->move_on) || ab->move_type == 0)
+ && (head->race == tmp->slaying
+ || (head->type == SPECIAL_KEY && head->slaying == tmp->slaying)
+ || (tmp->slaying == shstr_player && head->type == PLAYER)))
tmp->value = 1;
}
- if (tmp->value)
- any_down = 1;
+ any_down = any_down || tmp->value;
}
}
+
if (any_down) /* If any other buttons were down, force this to remain down */
op->value = 1;
+ //LOG(llevDebug, "update_button: %s (%d, %d=%d)\n", &op->name, op->count, op->value, old_value);
+
/* If this button hasn't changed, don't do anything */
if (op->value != old_value)
{
SET_ANIMATION (op, op->value);
update_object (op, UP_OBJ_FACE);
- push_button (op); /* Make all other buttons the same */
+ push_button (op, originator); /* Make all other buttons the same */
}
}
void
-use_trigger (object *op)
+use_trigger (object *op, object *originator)
{
/* Toggle value */
op->value = !op->value;
- push_button (op);
+
+ push_button (op, originator);
}
/*
@@ -321,7 +327,7 @@
&& !QUERY_FLAG (sacrifice, FLAG_IS_LINKED)
&& sacrifice->type != PLAYER)
{
- if (strcmp (ARCH_SACRIFICE (altar), "money") == 0
+ if (ARCH_SACRIFICE (altar) == shstr_money
&& sacrifice->type == MONEY
&& sacrifice->nrof * sacrifice->value >= NROF_SACRIFICE (altar))
return 1;
@@ -330,7 +336,7 @@
|| ARCH_SACRIFICE (altar) == sacrifice->name
|| ARCH_SACRIFICE (altar) == sacrifice->slaying
|| strstr (query_base_name (sacrifice, 0), ARCH_SACRIFICE (altar)))
- && NROF_SACRIFICE (altar) <= (sacrifice->nrof ? sacrifice->nrof : 1))
+ && NROF_SACRIFICE (altar) <= sacrifice->number_of ())
return 1;
}
@@ -364,7 +370,7 @@
/* check_altar_sacrifice should have already verified that enough money
* has been dropped.
*/
- if (!strcmp (ARCH_SACRIFICE (altar), "money"))
+ if (ARCH_SACRIFICE (altar) == shstr_money)
{
int number = NROF_SACRIFICE (altar) / (*sacrifice)->value;
@@ -372,10 +378,12 @@
if (NROF_SACRIFICE (altar) % (*sacrifice)->value)
number++;
- *sacrifice = decrease_ob_nr (*sacrifice, number);
+ if (!(*sacrifice)->decrease (number))
+ *sacrifice = 0;
}
else
- *sacrifice = decrease_ob_nr (*sacrifice, NROF_SACRIFICE (altar));
+ if (!(*sacrifice)->decrease (NROF_SACRIFICE (altar)))
+ *sacrifice = 0;
if (altar->msg)
new_info_map (NDI_BLACK, altar->map, altar->msg);
@@ -384,18 +392,19 @@
}
void
-trigger_move (object *op, int state) /* 1 down and 0 up */
+trigger_move (object *op, int state, object *originator) /* 1 down and 0 up */
{
op->stats.wc = state;
+
if (state)
{
- use_trigger (op);
+ use_trigger (op, originator);
op->set_speed (op->stats.exp > 0 ? 1. / op->stats.exp : 1.);
op->speed_left = -1;
}
else
{
- use_trigger (op);
+ use_trigger (op, originator);
op->set_speed (0);
}
}
@@ -422,289 +431,278 @@
switch (op->type)
{
- case TRIGGER_BUTTON:
- if (op->weight > 0)
- {
- if (cause)
- {
- for (tmp = op->above; tmp; tmp = tmp->above)
- /* Comment reproduced from update_buttons(): */
- /* Basically, if the move_type matches that on what the
- * button wants, we count it. The second check is so that
- * objects that don't move (swords, etc) will count. Note that
- * this means that more work is needed to make buttons
- * that are only triggered by flying objects.
- */
+ case TRIGGER_BUTTON:
+ if (op->weight > 0)
+ {
+ if (cause)
+ {
+ for (tmp = op->above; tmp; tmp = tmp->above)
+ /* Comment reproduced from update_buttons(): */
+ /* Basically, if the move_type matches that on what the
+ * button wants, we count it. The second check is so that
+ * objects that don't move (swords, etc) will count. Note that
+ * this means that more work is needed to make buttons
+ * that are only triggered by flying objects.
+ */
+ if ((tmp->move_type & op->move_on) || tmp->move_type == 0)
+ tot += tmp->head_ ()->total_weight ();
+
+ if (tot >= op->weight)
+ push = 1;
+
+ if (op->stats.ac == push)
+ return 0;
+
+ op->stats.ac = push;
+ if (NUM_ANIMATIONS (op) > 1)
+ {
+ SET_ANIMATION (op, push);
+ update_object (op, UP_OBJ_FACE);
+ }
+
+ if (in_movement || !push)
+ return 0;
+ }
+
+ trigger_move (op, push, cause);
+ }
- if ((tmp->move_type & op->move_on) || tmp->move_type == 0)
- {
- tot += tmp->weight * (tmp->nrof ? tmp->nrof : 1) + tmp->carrying;
- }
- if (tot >= op->weight)
+ return 0;
+
+ case TRIGGER_PEDESTAL:
+ if (cause)
+ {
+ for (tmp = op->above; tmp; tmp = tmp->above)
+ {
+ object *head = tmp->head_ ();
+
+ /* See comment in TRIGGER_BUTTON about move_types */
+ if (((head->move_type & op->move_on) || head->move_type == 0)
+ && (head->race == op->slaying || (op->slaying == shstr_player && head->type == PLAYER)))
+ {
push = 1;
- if (op->stats.ac == push)
- return 0;
- op->stats.ac = push;
- if (NUM_ANIMATIONS (op) > 1)
- {
- SET_ANIMATION (op, push);
- update_object (op, UP_OBJ_FACE);
- }
- if (in_movement || !push)
- return 0;
- }
- trigger_move (op, push);
- }
- return 0;
-
- case TRIGGER_PEDESTAL:
- if (cause)
- {
- for (tmp = op->above; tmp; tmp = tmp->above)
- {
- object *head = tmp->head_ ();
-
- /* See comment in TRIGGER_BUTTON about move_types */
- if (((head->move_type & op->move_on) || head->move_type == 0)
- && (head->race == op->slaying || (!strcmp (op->slaying, "player") && head->type == PLAYER)))
- {
- push = 1;
- break;
- }
- }
-
- if (op->stats.ac == push)
- return 0;
-
- op->stats.ac = push;
-
- if (NUM_ANIMATIONS (op) > 1)
- {
- SET_ANIMATION (op, push);
- update_object (op, UP_OBJ_FACE);
- }
-
- update_object (op, UP_OBJ_FACE);
-
- if (in_movement || !push)
- return 0;
- }
-
- trigger_move (op, push);
- return 0;
-
- case TRIGGER_ALTAR:
- if (cause)
- {
- if (in_movement)
- return 0;
-
- if (operate_altar (op, &cause))
- {
- if (NUM_ANIMATIONS (op) > 1)
- {
- SET_ANIMATION (op, 1);
- update_object (op, UP_OBJ_FACE);
- }
-
- if (op->last_sp >= 0)
- {
- trigger_move (op, 1);
- if (op->last_sp > 0)
- op->last_sp = -op->last_sp;
- }
- else
- {
- /* for trigger altar with last_sp, the ON/OFF
- * status (-> +/- value) is "simulated":
- */
- op->value = !op->value;
- trigger_move (op, 1);
+ break;
+ }
+ }
+
+ if (op->stats.ac == push)
+ return 0;
+
+ op->stats.ac = push;
+
+ if (NUM_ANIMATIONS (op) > 1)
+ {
+ SET_ANIMATION (op, push);
+ update_object (op, UP_OBJ_FACE);
+ }
+
+ update_object (op, UP_OBJ_FACE);
+
+ if (in_movement || !push)
+ return 0;
+ }
+
+ trigger_move (op, push, cause);
+ return 0;
+
+ case TRIGGER_ALTAR:
+ if (cause)
+ {
+ if (in_movement)
+ return 0;
+
+ if (operate_altar (op, &cause))
+ {
+ if (NUM_ANIMATIONS (op) > 1)
+ {
+ SET_ANIMATION (op, 1);
+ update_object (op, UP_OBJ_FACE);
+ }
+
+ if (op->last_sp >= 0)
+ {
+ trigger_move (op, 1, cause);
+
+ if (op->last_sp > 0)
op->last_sp = -op->last_sp;
- op->value = !op->value;
- }
+ }
+ else
+ {
+ /* for trigger altar with last_sp, the ON/OFF
+ * status (-> +/- value) is "simulated":
+ */
+ op->value = !op->value;
+ trigger_move (op, 1, cause);
+ op->last_sp = -op->last_sp;
+ op->value = !op->value;
+ }
- return cause == NULL;
- }
- else
- return 0;
- }
- else
- {
- if (NUM_ANIMATIONS (op) > 1)
- {
- SET_ANIMATION (op, 0);
- update_object (op, UP_OBJ_FACE);
- }
-
- /* If trigger_altar has "last_sp > 0" set on the map,
- * it will push the connected value only once per sacrifice.
- * Otherwise (default), the connected value will be
- * pushed twice: First by sacrifice, second by reset! -AV
- */
- if (!op->last_sp)
- trigger_move (op, 0);
- else
- {
- op->stats.wc = 0;
- op->value = !op->value;
- op->set_speed (0);
- }
- }
- return 0;
+ return cause == NULL;
+ }
+ else
+ return 0;
+ }
+ else
+ {
+ if (NUM_ANIMATIONS (op) > 1)
+ {
+ SET_ANIMATION (op, 0);
+ update_object (op, UP_OBJ_FACE);
+ }
- case TRIGGER:
- if (cause)
- {
- if (in_movement)
- return 0;
+ /* If trigger_altar has "last_sp > 0" set on the map,
+ * it will push the connected value only once per sacrifice.
+ * Otherwise (default), the connected value will be
+ * pushed twice: First by sacrifice, second by reset! -AV
+ */
+ if (!op->last_sp)
+ trigger_move (op, 0, cause);
+ else
+ {
+ op->stats.wc = 0;
+ op->value = !op->value;
+ op->set_speed (0);
+ }
+ }
+ return 0;
- push = 1;
- }
+ case TRIGGER:
+ if (cause)
+ {
+ if (in_movement)
+ return 0;
+
+ push = 1;
+ }
- if (NUM_ANIMATIONS (op) > 1)
- {
- SET_ANIMATION (op, push);
- update_object (op, UP_OBJ_FACE);
- }
+ if (NUM_ANIMATIONS (op) > 1)
+ {
+ SET_ANIMATION (op, push);
+ update_object (op, UP_OBJ_FACE);
+ }
- trigger_move (op, push);
- return 1;
+ trigger_move (op, push, cause);
+ return 1;
- default:
- LOG (llevDebug, "Unknown trigger type: %s (%d)\n", &op->name, op->type);
- return 0;
+ default:
+ LOG (llevDebug, "Unknown trigger type: %s (%d)\n", &op->name, op->type);
+ return 0;
}
}
void
-add_button_link (object *button, maptile *map, int connected)
+object::add_link (maptile *map, shstr_tmp id)
{
- oblinkpt *obp;
- objectlink *ol = get_objectlink ();
-
if (!map)
{
LOG (llevError, "Tried to add button-link without map.\n");
return;
}
- button->path_attuned = connected; /* peterm: I need this so I can rebuild
- a connected map from a template map. */
-
- SET_FLAG (button, FLAG_IS_LINKED);
+ flag [FLAG_IS_LINKED] = true;
- ol->ob = button;
+ objectlink *ol = get_objectlink ();
+ ol->ob = this;
- for (obp = map->buttons; obp && obp->value != connected; obp = obp->next)
- ;
+ for (oblinkpt *obp = map->buttons; obp; obp = obp->next)
+ if (obp->id == id)
+ {
+ ol->next = obp->link;
+ obp->link = ol;
+ return;
+ }
- if (obp)
- {
- ol->next = obp->link;
- obp->link = ol;
- }
- else
- {
- obp = get_objectlinkpt ();
- obp->value = connected;
+ oblinkpt *obp = get_objectlinkpt ();
+ obp->id = id;
- obp->next = map->buttons;
- map->buttons = obp;
- obp->link = ol;
- }
+ obp->next = map->buttons;
+ map->buttons = obp;
+ obp->link = ol;
}
/*
* Remove the object from the linked lists of buttons in the map.
* This is only needed by editors.
*/
-
void
-remove_button_link (object *op)
+object::remove_link ()
{
- oblinkpt *obp;
- objectlink **olp, *ol;
-
- if (op->map == NULL)
+ if (!map)
{
LOG (llevError, "remove_button_link() in object without map.\n");
return;
}
- if (!QUERY_FLAG (op, FLAG_IS_LINKED))
+ if (!flag [FLAG_IS_LINKED])
{
LOG (llevError, "remove_button_linked() in unlinked object.\n");
return;
}
- for (obp = op->map->buttons; obp; obp = obp->next)
- for (olp = &obp->link; (ol = *olp); olp = &ol->next)
- if (ol->ob == op)
- {
+ flag [FLAG_IS_LINKED] = false;
-/* LOG(llevDebug, "Removed link %d in button %s and map %s.\n",
- obp->value, op->name, op->map->path);
-*/
+ for (oblinkpt *obp = map->buttons; obp; obp = obp->next)
+ for (objectlink **olp = &obp->link; *olp; olp = &(*olp)->next)
+ if ((*olp)->ob == this)
+ {
+ objectlink *ol = *olp;
*olp = ol->next;
delete ol;
return;
}
LOG (llevError, "remove_button_linked(): couldn't find object.\n");
- CLEAR_FLAG (op, FLAG_IS_LINKED);
}
/*
- * Gets the objectlink for this connection from the map.
+ * Updates every button on the map (by calling update_button() for them).
*/
-oblinkpt *
-get_connection_links (maptile *map, long connection)
+void
+maptile::update_buttons ()
{
- for (oblinkpt * obp = map->buttons; obp; obp = obp->next)
- if (obp->value == connection)
- return obp;
+ for (oblinkpt *obp = buttons; obp; obp = obp->next)
+ for (objectlink *ol = obp->link; ol; ol = ol->next)
+ {
+ if (!ol->ob)
+ {
+ LOG (llevError, "Internal error in update_button (%s (%dx%d), connected %ld).\n",
+ ol->ob ? (const char *) ol->ob->name : "null", ol->ob ? ol->ob->x : -1, ol->ob ? ol->ob->y : -1, &obp->id);
+ continue;
+ }
- return 0;
+ if (ol->ob->type == BUTTON || ol->ob->type == PEDESTAL)
+ {
+ update_button (ol->ob, 0);
+ break;
+ }
+ }
}
/*
- * Return the first objectlink in the objects linked to this one
+ * Gets the objectlink for this connection from the map.
*/
-
oblinkpt *
-get_button_links (const object *button)
+maptile::find_link (shstr_tmp id)
{
- oblinkpt *obp;
- objectlink *ol;
-
- if (!button->map)
- return NULL;
-
- for (obp = button->map->buttons; obp; obp = obp->next)
- for (ol = obp->link; ol; ol = ol->next)
- if (ol->ob == button)
- return obp;
+ for (oblinkpt *obp = buttons; obp; obp = obp->next)
+ if (obp->id == id)
+ return obp;
- return NULL;
+ return 0;
}
/*
- * Made as a separate function to increase efficiency
+ * Return the first objectlink in the objects linked to this one
*/
-
-int
-get_button_value (const object *button)
+oblinkpt *
+object::find_link () const
{
- oblinkpt *obp;
- objectlink *ol;
+ if (map)
+ for (oblinkpt *obp = map->buttons; obp; obp = obp->next)
+ for (objectlink *ol = obp->link; ol; ol = ol->next)
+ if (ol->ob == this)
+ return obp;
- if (!button->map)
- return 0;
- for (obp = button->map->buttons; obp; obp = obp->next)
- for (ol = obp->link; ol; ol = ol->next)
- if (ol->ob == button)
- return obp->value;
return 0;
}
@@ -716,7 +714,6 @@
* but the charm floor type).
* by b.t. thomas@nomad.astro.psu.edu
*/
-
void
do_mood_floor (object *op, object *source)
{
@@ -802,7 +799,7 @@
case 5: // kill all alives
if (!tmp->flag [FLAG_PRECIOUS])
{
- get_archetype ("burnout")->insert_at (tmp, source);
+ archetype::get (shstr_burnout)->insert_at (tmp, source);
tmp->destroy ();
}
break;
@@ -887,15 +884,15 @@
if (match && trig->last_sp) // match == having
{
if (trig->last_heal)
- decrease_ob (match);
+ match->decrease ();
trig->value = (pl == op ? 1 : 0); // 1 if matching player entered, and 0 if he left
- push_button (trig);
+ push_button (trig, op);
}
else if (!match && !trig->last_sp) // match == not having
{
trig->value = (pl == op ? 1 : 0); // 1 if matching player entered, and 0 if he left
- push_button (trig);
+ push_button (trig, op);
}
}