--- deliantra/server/common/button.C 2009/11/10 20:57:56 1.63
+++ deliantra/server/common/button.C 2012/11/12 03:14:32 1.71
@@ -1,24 +1,24 @@
/*
* This file is part of Deliantra, the Roguelike Realtime MMORPG.
- *
- * Copyright (©) 2005,2006,2007,2008,2009 Marc Alexander Lehmann / Robin Redeker / the Deliantra team
- * Copyright (©) 2002,2007 Mark Wedel & Crossfire Development Team
- * Copyright (©) 1992,2007 Frank Tore Johansen
- *
+ *
+ * Copyright (©) 2005,2006,2007,2008,2009,2010,2011,2012 Marc Alexander Lehmann / Robin Redeker / the Deliantra team
+ * Copyright (©) 2002 Mark Wedel & Crossfire Development Team
+ * Copyright (©) 1992 Frank Tore Johansen
+ *
* Deliantra is free software: you can redistribute it and/or modify it under
* the terms of the Affero GNU General Public License as published by the
* Free Software Foundation, either version 3 of the License, or (at your
* option) any later version.
- *
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
- *
+ *
* You should have received a copy of the Affero GNU General Public License
* and the GNU General Public License along with this program. If not, see
* .
- *
+ *
* The authors can be reached via e-mail to
*/
@@ -54,16 +54,16 @@
* re-loaded. As such, just exit this function if that is the case.
*/
- if (QUERY_FLAG (ol->ob, FLAG_FREED))
+ if (ol->ob->flag [FLAG_FREED])
return;
object *tmp = ol->ob;
/* if the criteria isn't appropriate, don't do anything */
- if (state && !QUERY_FLAG (tmp, FLAG_ACTIVATE_ON_PUSH))
+ if (state && !tmp->flag [FLAG_ACTIVATE_ON_PUSH])
continue;
- if (!state && !QUERY_FLAG (tmp, FLAG_ACTIVATE_ON_RELEASE))
+ if (!state && !tmp->flag [FLAG_ACTIVATE_ON_RELEASE])
continue;
switch (tmp->type)
@@ -139,7 +139,7 @@
case DIRECTOR:
case FIREWALL:
- if (!QUERY_FLAG (tmp, FLAG_ANIMATE) && tmp->type == FIREWALL)
+ if (!tmp->flag [FLAG_ANIMATE] && tmp->type == FIREWALL)
move_firewall (tmp);
else
{
@@ -238,7 +238,7 @@
if (tmp->type == BUTTON)
{
- sint32 total = 0;
+ weight_t total = 0;
for (object *ab = tmp->above; ab; ab = ab->above)
/* Basically, if the move_type matches that on what the
@@ -351,15 +351,15 @@
int
check_altar_sacrifice (object *altar, object *sacrifice, object *originator)
{
- if (sacrifice->flag [FLAG_UNPAID])
+ if (sacrifice->flag [FLAG_UNPAID]
+ || sacrifice->flag [FLAG_IS_LINKED]
+ || sacrifice->is_player ())
return 0;
if (is_match_expr (ARCH_SACRIFICE (altar)))
- return match (ARCH_SACRIFICE (altar), altar, originator);
+ return match (ARCH_SACRIFICE (altar), sacrifice, altar, originator);
- if (!QUERY_FLAG (sacrifice, FLAG_ALIVE)
- && !QUERY_FLAG (sacrifice, FLAG_IS_LINKED)
- && sacrifice->type != PLAYER)
+ if (!sacrifice->flag [FLAG_ALIVE])
{
if (ARCH_SACRIFICE (altar) == shstr_money
&& sacrifice->type == MONEY
@@ -762,7 +762,7 @@
object *tmp;
for (tmp = ms.top; tmp; tmp = tmp->below)
- if (QUERY_FLAG (tmp, FLAG_MONSTER))
+ if (tmp->flag [FLAG_MONSTER])
break;
/* doesn't effect players, and if there is a player on this space, won't also
@@ -775,10 +775,10 @@
switch (op->last_sp)
{
case 0: /* furious--make all monsters mad */
- if (QUERY_FLAG (tmp, FLAG_UNAGGRESSIVE))
- CLEAR_FLAG (tmp, FLAG_UNAGGRESSIVE);
+ if (tmp->flag [FLAG_UNAGGRESSIVE])
+ tmp->clr_flag (FLAG_UNAGGRESSIVE);
- if (QUERY_FLAG (tmp, FLAG_FRIENDLY))
+ if (tmp->flag [FLAG_FRIENDLY])
{
tmp->attack_movement = 0;
/* lots of checks here, but want to make sure we don't
@@ -797,16 +797,16 @@
break;
case 1: /* angry -- get neutral monsters mad */
- if (QUERY_FLAG (tmp, FLAG_UNAGGRESSIVE) && !QUERY_FLAG (tmp, FLAG_FRIENDLY))
- CLEAR_FLAG (tmp, FLAG_UNAGGRESSIVE);
+ if (tmp->flag [FLAG_UNAGGRESSIVE] && !tmp->flag [FLAG_FRIENDLY])
+ tmp->clr_flag (FLAG_UNAGGRESSIVE);
break;
case 2: /* calm -- pacify unfriendly monsters */
- SET_FLAG (tmp, FLAG_UNAGGRESSIVE);
+ tmp->set_flag (FLAG_UNAGGRESSIVE);
break;
case 3: /* make all monsters fall asleep */
- SET_FLAG (tmp, FLAG_SLEEP);
+ tmp->set_flag (FLAG_SLEEP);
break;
case 4: /* charm all monsters */
@@ -816,7 +816,7 @@
if (object *pl = source->ms ().player ())
{
tmp->set_owner (pl);
- SET_FLAG (tmp, FLAG_MONSTER);
+ tmp->set_flag (FLAG_MONSTER);
tmp->stats.exp = 0;
@@ -826,7 +826,7 @@
break;
case 6: // kill monsters
- if (!QUERY_FLAG (tmp, FLAG_FRIENDLY))
+ if (!tmp->flag [FLAG_FRIENDLY])
break;
// FALL THROUGH