--- deliantra/server/server/move.C 2010/03/26 00:53:26 1.37 +++ deliantra/server/server/move.C 2012/01/27 22:00:40 1.45 @@ -1,9 +1,9 @@ /* * This file is part of Deliantra, the Roguelike Realtime MMORPG. * - * 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 + * 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 @@ -77,6 +77,8 @@ remove (); + pos.m->activate (); + if (INVOKE_PLAYER (MAP_CHANGE, contr, ARG_MAP (pos.m), ARG_INT (pos.x), ARG_INT (pos.y))) return 0; @@ -106,7 +108,6 @@ transfer_ob (object *op, int x, int y, int randomly, object *originator) { int i; - object *tmp; if (randomly) i = find_free_spot (op, op->map, x, y, 0, SIZEOFFREE); @@ -178,7 +179,7 @@ return 0; } - int k = find_free_spot (user, other_teleporter->map, other_teleporter->x, other_teleporter->y, 1, 9); + int k = find_free_spot (user, other_teleporter->map, other_teleporter->x, other_teleporter->y, 1, SIZEOFFREE1 + 1); /* if k==-1, unable to find a free spot. If this is shop * mat that the player is using, find someplace to move @@ -254,7 +255,7 @@ if (tmp->head == op || tmp == op) continue; - if ((QUERY_FLAG (tmp, FLAG_ALIVE) && tmp->type != DOOR)) + if ((tmp->flag [FLAG_ALIVE] && tmp->type != DOOR)) return 1; if (OB_MOVE_BLOCK (op, tmp)) @@ -284,7 +285,7 @@ x = op->x + freearr_x[dir]; y = op->y + freearr_y[dir]; - if (!QUERY_FLAG (op, FLAG_CAN_ROLL) + if (!op->flag [FLAG_CAN_ROLL] || (op->weight && random_roll (0, op->weight / 50000 - 1, pusher, PREFER_LOW) > pusher->stats.Str)) return 0; @@ -344,7 +345,7 @@ owner = who->owner; /* Wake up sleeping monsters that may be pushed */ - CLEAR_FLAG (who, FLAG_SLEEP); + who->clr_flag (FLAG_SLEEP); /* player change place with his pets or summoned creature */ /* TODO: allow multi arch pushing. Can't be very difficult */ @@ -381,12 +382,12 @@ /* we so often become an enemy of friendly monsters... */ /* funny: was they set to unaggressive 0 (= not so nice) they don't attack */ if (owner != pusher && pusher->type == PLAYER && who->type != PLAYER && - !QUERY_FLAG (who, FLAG_FRIENDLY) && !QUERY_FLAG (who, FLAG_NEUTRAL)) + !who->flag [FLAG_FRIENDLY] && !who->flag [FLAG_NEUTRAL]) { if (pusher->contr->run_on) /* only when we run */ { new_draw_info_format (NDI_UNIQUE, 0, pusher, "You start to attack %s!!", &who->name); - CLEAR_FLAG (who, FLAG_UNAGGRESSIVE); /* the sucker don't like you anymore */ + who->clr_flag (FLAG_UNAGGRESSIVE); /* the sucker don't like you anymore */ who->enemy = pusher; return 1; } @@ -395,7 +396,7 @@ } /* now, let's test stand still. we NEVER can push stand_still monsters. */ - if (QUERY_FLAG (who, FLAG_STAND_STILL)) + if (who->flag [FLAG_STAND_STILL]) { new_draw_info_format (NDI_UNIQUE, 0, pusher, "You can't push %s. H", &who->name); return 0; @@ -410,7 +411,7 @@ str1 = (who->stats.Str > 0 ? who->stats.Str : who->level); str2 = (pusher->stats.Str > 0 ? pusher->stats.Str : pusher->level); - if (QUERY_FLAG (who, FLAG_WIZ) || + if (who->flag [FLAG_WIZ] || random_roll (str1, str1 * 5 / 2, who, PREFER_HIGH) >= random_roll (str2, str2 * 5 / 2, pusher, PREFER_HIGH) || !who->move (dir)) {