test for FORBIDDEN_REGION moved out of standard-to-astral function, becasue that annoys the editor.

This commit is contained in:
Enno Rehling 2008-05-20 15:15:02 +00:00
parent 390bf522f7
commit 5d4c66762b
3 changed files with 7 additions and 12 deletions

View file

@ -2886,6 +2886,7 @@ age_building(building * b)
region * rt = r_standard_to_astral(r);
unit * u, * mage = NULL;
if (fval(rt->terrain, FORBIDDEN_REGION)) rt = NULL;
/* step 1: give unicorns to people in the building,
* find out if there's a magician in there. */
for (u=r->units;u;u=u->next) {

View file

@ -92,14 +92,8 @@ astralregions(const region * r, boolean (*valid)(const region *))
region *
r_standard_to_astral(const region *r)
{
region *r2;
if (rplane(r) != get_normalplane()) return NULL;
r2 = tpregion(r);
if (r2==NULL || fval(r2->terrain, FORBIDDEN_REGION)) return NULL;
return r2;
return tpregion(r);
}
region *

View file

@ -1752,7 +1752,7 @@ sp_treewalkenter(castorder *co)
}
rt = r_standard_to_astral(r);
if (rt==NULL || is_cursed(rt->attribs, C_ASTRALBLOCK, 0)) {
if (rt==NULL || is_cursed(rt->attribs, C_ASTRALBLOCK, 0) || fval(rt->terrain, FORBIDDEN_REGION)) {
ADDMSG(&mage->faction->msgs, msg_feedback(mage, co->order, "spellfail_astralblock", ""));
return 0;
}
@ -3396,7 +3396,7 @@ sp_chaossuction(castorder *co)
rt = r_standard_to_astral(r);
if (rt==NULL) {
if (rt==NULL || fval(rt->terrain, FORBIDDEN_REGION)) {
/* Hier gibt es keine Verbindung zur astralen Welt.*/
cmistake(mage, co->order, 216, MSG_MAGIC);
return 0;
@ -5338,7 +5338,7 @@ sp_enterastral(castorder *co)
return 0;
}
if (!rt) {
if (!rt || fval(rt->terrain, FORBIDDEN_REGION)) {
ADDMSG(&mage->faction->msgs, msg_feedback(mage, co->order, "feedback_no_astralregion", ""));
return 0;
}
@ -5775,7 +5775,7 @@ sp_showastral(castorder *co)
switch(getplaneid(r)) {
case 0:
rt = r_standard_to_astral(r);
if (!rt) {
if (!rt || fval(rt->terrain, FORBIDDEN_REGION)) {
/* Hier gibt es keine Verbindung zur astralen Welt */
cmistake(mage, co->order, 216, MSG_MAGIC);
return 0;
@ -5905,7 +5905,7 @@ sp_disruptastral(castorder *co)
switch(getplaneid(r)) {
case 0:
rt = r_standard_to_astral(r);
if (!rt) {
if (!rt || fval(rt->terrain, FORBIDDEN_REGION)) {
/* "Hier gibt es keine Verbindung zur astralen Welt." */
cmistake(mage, co->order, 216, MSG_MAGIC);
return 0;