forked from github/server
- 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:
parent
85d0383471
commit
b1fa0e3dd5
5 changed files with 313 additions and 307 deletions
|
@ -1345,10 +1345,10 @@ report_computer(FILE * F, faction * f, const faction_list * addresses,
|
||||||
}
|
}
|
||||||
print_curses(F, f, r, TYP_REGION);
|
print_curses(F, f, r, TYP_REGION);
|
||||||
cr_borders(r, f, sd->mode, F);
|
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 */
|
/* Sonderbehandlung Teleport-Ebene */
|
||||||
region_list *rl = astralregions(r_astral_to_standard(r), inhabitable);
|
region_list *rl = astralregions(r, inhabitable);
|
||||||
|
|
||||||
if (rl) {
|
if (rl) {
|
||||||
region_list *rl2 = rl;
|
region_list *rl2 = rl;
|
||||||
|
|
|
@ -1364,10 +1364,10 @@ describe(FILE * F, const region * r, int partial, faction * f)
|
||||||
rparagraph(F, buf, 0, 0);
|
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)) {
|
!is_cursed(r->attribs, C_ASTRALBLOCK, 0)) {
|
||||||
/* Sonderbehandlung Teleport-Ebene */
|
/* Sonderbehandlung Teleport-Ebene */
|
||||||
region_list *rl = astralregions(r_astral_to_standard(r), inhabitable);
|
region_list *rl = astralregions(r, inhabitable);
|
||||||
region_list *rl2;
|
region_list *rl2;
|
||||||
|
|
||||||
if (rl) {
|
if (rl) {
|
||||||
|
|
|
@ -1939,7 +1939,7 @@ sp_treewalkexit(castorder *co)
|
||||||
tay = rt->y;
|
tay = rt->y;
|
||||||
rt = NULL;
|
rt = NULL;
|
||||||
|
|
||||||
rl = astralregions(r_astral_to_standard(r), inhabitable);
|
rl = astralregions(r, inhabitable);
|
||||||
rt = 0;
|
rt = 0;
|
||||||
|
|
||||||
rl2 = rl;
|
rl2 = rl;
|
||||||
|
@ -5930,11 +5930,11 @@ sp_pullastral(castorder *co)
|
||||||
spellparameter *pa = co->par;
|
spellparameter *pa = co->par;
|
||||||
spell *sp = co->sp;
|
spell *sp = co->sp;
|
||||||
|
|
||||||
switch(getplaneid(r)) {
|
switch (getplaneid(r)) {
|
||||||
case 1:
|
case 1:
|
||||||
rt = r;
|
rt = r;
|
||||||
ro = pa->param[0]->data.r;
|
ro = pa->param[0]->data.r;
|
||||||
rl = astralregions(r_astral_to_standard(r), NULL);
|
rl = astralregions(r, NULL);
|
||||||
rl2 = rl;
|
rl2 = rl;
|
||||||
while (rl2!=NULL) {
|
while (rl2!=NULL) {
|
||||||
region * r2 = rl2->data;
|
region * r2 = rl2->data;
|
||||||
|
@ -6042,7 +6042,6 @@ sp_pullastral(castorder *co)
|
||||||
return cast_level;
|
return cast_level;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int
|
int
|
||||||
sp_leaveastral(castorder *co)
|
sp_leaveastral(castorder *co)
|
||||||
{
|
{
|
||||||
|
@ -6066,7 +6065,7 @@ sp_leaveastral(castorder *co)
|
||||||
MSG_MAGIC, ML_MISTAKE);
|
MSG_MAGIC, ML_MISTAKE);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
rl = astralregions(r_astral_to_standard(r), inhabitable);
|
rl = astralregions(r, inhabitable);
|
||||||
rl2 = rl;
|
rl2 = rl;
|
||||||
while (rl2!=NULL) {
|
while (rl2!=NULL) {
|
||||||
if (rl2->data == rt) break;
|
if (rl2->data == rt) break;
|
||||||
|
@ -6391,7 +6390,7 @@ sp_viewreality(castorder *co)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
rl = astralregions(r_astral_to_standard(r), NULL);
|
rl = astralregions(r, NULL);
|
||||||
|
|
||||||
/* Irgendwann mal auf Curses u/o Attribut umstellen. */
|
/* Irgendwann mal auf Curses u/o Attribut umstellen. */
|
||||||
for (rl2=rl; rl2; rl2=rl2->next) {
|
for (rl2=rl; rl2; rl2=rl2->next) {
|
||||||
|
@ -6454,7 +6453,7 @@ sp_disruptastral(castorder *co)
|
||||||
if (r2->units!=NULL) {
|
if (r2->units!=NULL) {
|
||||||
region_list * trl2;
|
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;
|
for (trl2 = trl; trl2; trl2 = trl2->next) ++inhab_regions;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -31,6 +31,9 @@
|
||||||
#include "faction.h"
|
#include "faction.h"
|
||||||
#include "plane.h"
|
#include "plane.h"
|
||||||
|
|
||||||
|
/* util includes */
|
||||||
|
#include <log.h>
|
||||||
|
|
||||||
/* libc includes */
|
/* libc includes */
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
@ -60,9 +63,13 @@ astralregions(const region * r, boolean (*valid)(const region *))
|
||||||
region_list * rlist = NULL;
|
region_list * rlist = NULL;
|
||||||
int x, y;
|
int x, y;
|
||||||
|
|
||||||
assert(rplane(r) == NULL);
|
assert(rplane(r) == get_astralplane());
|
||||||
if (r==NULL) return NULL;
|
if (rplane(r) != get_astralplane()) {
|
||||||
|
log_error(("astralregions was called with a non-astral region.\n"));
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
r = r_astral_to_standard(r);
|
r = r_astral_to_standard(r);
|
||||||
|
if (r==NULL) return NULL;
|
||||||
|
|
||||||
for (x=r->x-TP_RADIUS;x<=r->x+TP_RADIUS;++x) {
|
for (x=r->x-TP_RADIUS;x<=r->x+TP_RADIUS;++x) {
|
||||||
for (y=r->y-TP_RADIUS;y<=r->y+TP_RADIUS;++y) {
|
for (y=r->y-TP_RADIUS;y<=r->y+TP_RADIUS;++y) {
|
||||||
|
|
|
@ -20,7 +20,7 @@ extern "C" {
|
||||||
|
|
||||||
struct region *r_standard_to_astral(const struct region *r);
|
struct region *r_standard_to_astral(const struct region *r);
|
||||||
struct region *r_astral_to_standard(const struct region *);
|
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 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 boolean inhabitable(const struct region * r);
|
||||||
extern struct plane * get_astralplane(void);
|
extern struct plane * get_astralplane(void);
|
||||||
|
|
Loading…
Reference in a new issue