- beim fixen des bugs habe ich einen Fehler gemacht, der die Liste der Schemen auf 0 reduziert, und allen Kontakt vom Astral- zum Normalraum unterbricht.

Bei der Gelegenheit bessere Fehlererkennung eingebaut.
This commit is contained in:
Enno Rehling 2004-05-25 08:53:59 +00:00
parent 85d0383471
commit b1fa0e3dd5
5 changed files with 313 additions and 307 deletions

View File

@ -1345,10 +1345,10 @@ report_computer(FILE * F, faction * f, const faction_list * addresses,
}
print_curses(F, f, r, TYP_REGION);
cr_borders(r, f, sd->mode, F);
if (sd->mode==see_unit && r->planep && r->planep->id == 1 && !is_cursed(r->attribs, C_ASTRALBLOCK, 0))
if (sd->mode==see_unit && rplane(r)==get_astralplane() && !is_cursed(r->attribs, C_ASTRALBLOCK, 0))
{
/* Sonderbehandlung Teleport-Ebene */
region_list *rl = astralregions(r_astral_to_standard(r), inhabitable);
region_list *rl = astralregions(r, inhabitable);
if (rl) {
region_list *rl2 = rl;

View File

@ -1364,10 +1364,10 @@ describe(FILE * F, const region * r, int partial, faction * f)
rparagraph(F, buf, 0, 0);
}
if (partial==0 && r->planep && r->planep->id == 1 &&
if (partial==0 && rplane(r) == get_astralplane() &&
!is_cursed(r->attribs, C_ASTRALBLOCK, 0)) {
/* Sonderbehandlung Teleport-Ebene */
region_list *rl = astralregions(r_astral_to_standard(r), inhabitable);
region_list *rl = astralregions(r, inhabitable);
region_list *rl2;
if (rl) {

View File

@ -1939,7 +1939,7 @@ sp_treewalkexit(castorder *co)
tay = rt->y;
rt = NULL;
rl = astralregions(r_astral_to_standard(r), inhabitable);
rl = astralregions(r, inhabitable);
rt = 0;
rl2 = rl;
@ -5930,11 +5930,11 @@ sp_pullastral(castorder *co)
spellparameter *pa = co->par;
spell *sp = co->sp;
switch(getplaneid(r)) {
switch (getplaneid(r)) {
case 1:
rt = r;
ro = pa->param[0]->data.r;
rl = astralregions(r_astral_to_standard(r), NULL);
rl = astralregions(r, NULL);
rl2 = rl;
while (rl2!=NULL) {
region * r2 = rl2->data;
@ -6042,7 +6042,6 @@ sp_pullastral(castorder *co)
return cast_level;
}
int
sp_leaveastral(castorder *co)
{
@ -6066,7 +6065,7 @@ sp_leaveastral(castorder *co)
MSG_MAGIC, ML_MISTAKE);
return 0;
}
rl = astralregions(r_astral_to_standard(r), inhabitable);
rl = astralregions(r, inhabitable);
rl2 = rl;
while (rl2!=NULL) {
if (rl2->data == rt) break;
@ -6391,7 +6390,7 @@ sp_viewreality(castorder *co)
return 0;
}
rl = astralregions(r_astral_to_standard(r), NULL);
rl = astralregions(r, NULL);
/* Irgendwann mal auf Curses u/o Attribut umstellen. */
for (rl2=rl; rl2; rl2=rl2->next) {
@ -6454,7 +6453,7 @@ sp_disruptastral(castorder *co)
if (r2->units!=NULL) {
region_list * trl2;
trl = astralregions(r_astral_to_standard(rl2->data), inhabitable);
trl = astralregions(rl2->data, inhabitable);
for (trl2 = trl; trl2; trl2 = trl2->next) ++inhab_regions;
}

View File

@ -31,6 +31,9 @@
#include "faction.h"
#include "plane.h"
/* util includes */
#include <log.h>
/* libc includes */
#include <assert.h>
#include <stdlib.h>
@ -60,9 +63,13 @@ astralregions(const region * r, boolean (*valid)(const region *))
region_list * rlist = NULL;
int x, y;
assert(rplane(r) == NULL);
if (r==NULL) return NULL;
assert(rplane(r) == get_astralplane());
if (rplane(r) != get_astralplane()) {
log_error(("astralregions was called with a non-astral region.\n"));
return NULL;
}
r = r_astral_to_standard(r);
if (r==NULL) return NULL;
for (x=r->x-TP_RADIUS;x<=r->x+TP_RADIUS;++x) {
for (y=r->y-TP_RADIUS;y<=r->y+TP_RADIUS;++y) {

View File

@ -20,7 +20,7 @@ extern "C" {
struct region *r_standard_to_astral(const struct region *r);
struct region *r_astral_to_standard(const struct region *);
extern struct region_list *astralregions(const struct region * r, boolean (*valid)(const struct region *));
extern struct region_list *astralregions(const struct region * rastral, boolean (*valid)(const struct region *));
extern struct region_list *all_in_range(const struct region *r, int n, boolean (*valid)(const struct region *));
extern boolean inhabitable(const struct region * r);
extern struct plane * get_astralplane(void);