forked from github/server
* Doppelte keys (entfernt aber nicht die, die schon im DF sind)
* Neue Queste * Bugfix Irrlichter
This commit is contained in:
parent
e7c9e10b98
commit
f285f5a104
|
@ -26,6 +26,14 @@ attrib_type at_key = {
|
||||||
a_readdefault,
|
a_readdefault,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
attrib *
|
||||||
|
add_key(attrib ** alist, int key)
|
||||||
|
{
|
||||||
|
attrib * a = find_key(*alist, key);
|
||||||
|
if (a==NULL) a = a_add(alist, make_key(key));
|
||||||
|
return a;
|
||||||
|
}
|
||||||
|
|
||||||
attrib *
|
attrib *
|
||||||
make_key(int key)
|
make_key(int key)
|
||||||
{
|
{
|
||||||
|
|
|
@ -16,4 +16,5 @@ extern struct attrib_type at_key;
|
||||||
|
|
||||||
extern struct attrib * make_key(int key);
|
extern struct attrib * make_key(int key);
|
||||||
extern struct attrib * find_key(struct attrib * alist, int key);
|
extern struct attrib * find_key(struct attrib * alist, int key);
|
||||||
|
extern struct attrib * add_key(struct attrib ** alist, int key);
|
||||||
extern void init_key(void);
|
extern void init_key(void);
|
||||||
|
|
|
@ -38,6 +38,7 @@
|
||||||
#include "race.h"
|
#include "race.h"
|
||||||
#include "region.h"
|
#include "region.h"
|
||||||
#include "render.h"
|
#include "render.h"
|
||||||
|
#include "spell.h"
|
||||||
#include "ship.h"
|
#include "ship.h"
|
||||||
#include "skill.h"
|
#include "skill.h"
|
||||||
#include "unit.h"
|
#include "unit.h"
|
||||||
|
@ -1020,13 +1021,16 @@ travel(region * first, unit * u, region * next, int flucht)
|
||||||
|
|
||||||
while (b) {
|
while (b) {
|
||||||
if (b->type==&bt_wisps) {
|
if (b->type==&bt_wisps) {
|
||||||
region * rl = rconnect(current, (direction_t)((dir+MAXDIRECTIONS-1)%MAXDIRECTIONS));
|
wall_data * wd = (wall_data*)b->data;
|
||||||
region * rr = rconnect(current, (direction_t)((dir+1)%MAXDIRECTIONS));
|
if (wd->active) {
|
||||||
int j = rand() % 3;
|
region * rl = rconnect(current, (direction_t)((dir+MAXDIRECTIONS-1)%MAXDIRECTIONS));
|
||||||
if (j==0) break;
|
region * rr = rconnect(current, (direction_t)((dir+1)%MAXDIRECTIONS));
|
||||||
else if (j==1 && rl && landregion(rterrain(rl))==landregion(rterrain(next))) next = rl;
|
int j = rand() % 3;
|
||||||
else if (j==2 && rr && landregion(rterrain(rr))==landregion(rterrain(next))) next = rr;
|
if (j==0) break;
|
||||||
break;
|
else if (j==1 && rl && landregion(rterrain(rl))==landregion(rterrain(next))) next = rl;
|
||||||
|
else if (j==2 && rr && landregion(rterrain(rr))==landregion(rterrain(next))) next = rr;
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (b->type->move) b->type->move(b, u, current, next);
|
if (b->type->move) b->type->move(b, u, current, next);
|
||||||
b = b->next;
|
b = b->next;
|
||||||
|
|
|
@ -678,14 +678,14 @@ gm_addquest(const char * email, const char * name, int radius, unsigned int flag
|
||||||
/* generic permissions */
|
/* generic permissions */
|
||||||
a = a_add(&f->attribs, a_new(&at_permissions));
|
a = a_add(&f->attribs, a_new(&at_permissions));
|
||||||
|
|
||||||
a_add((attrib**)&a->data.v, make_key(atoi36("gmterf")));
|
add_key((attrib**)&a->data.v, atoi36("gmterf"));
|
||||||
a_add((attrib**)&a->data.v, make_key(atoi36("gmgate")));
|
add_key((attrib**)&a->data.v, atoi36("gmtele"));
|
||||||
a_add((attrib**)&a->data.v, make_key(atoi36("gmtele")));
|
add_key((attrib**)&a->data.v, atoi36("gmgive"));
|
||||||
a_add((attrib**)&a->data.v, make_key(atoi36("gmgive")));
|
add_key((attrib**)&a->data.v, atoi36("gmskil"));
|
||||||
a_add((attrib**)&a->data.v, make_key(atoi36("gmskil")));
|
add_key((attrib**)&a->data.v, atoi36("gmtake"));
|
||||||
a_add((attrib**)&a->data.v, make_key(atoi36("gmtake")));
|
add_key((attrib**)&a->data.v, atoi36("gmmsgr"));
|
||||||
a_add((attrib**)&a->data.v, make_key(atoi36("gmmsgr")));
|
add_key((attrib**)&a->data.v, atoi36("gmmsgu"));
|
||||||
a_add((attrib**)&a->data.v, make_key(atoi36("gmmsgu")));
|
add_key((attrib**)&a->data.v, atoi36("gmgate"));
|
||||||
|
|
||||||
a_add((attrib**)&a->data.v, make_atgmcreate(resource2item(r_silver)));
|
a_add((attrib**)&a->data.v, make_atgmcreate(resource2item(r_silver)));
|
||||||
|
|
||||||
|
@ -716,7 +716,7 @@ gm_addfaction(const char * email, plane * p, region * r)
|
||||||
assert(p!=NULL);
|
assert(p!=NULL);
|
||||||
|
|
||||||
/* GM faction */
|
/* GM faction */
|
||||||
a_add(&f->attribs, make_key(atoi36("quest")));
|
add_key(&f->attribs, atoi36("quest"));
|
||||||
f->banner = strdup("Questenpartei");
|
f->banner = strdup("Questenpartei");
|
||||||
f->passw = strdup(itoa36(rand()));
|
f->passw = strdup(itoa36(rand()));
|
||||||
f->email = strdup(email);
|
f->email = strdup(email);
|
||||||
|
@ -740,14 +740,14 @@ gm_addfaction(const char * email, plane * p, region * r)
|
||||||
/* generic permissions */
|
/* generic permissions */
|
||||||
a = a_add(&f->attribs, a_new(&at_permissions));
|
a = a_add(&f->attribs, a_new(&at_permissions));
|
||||||
|
|
||||||
a_add((attrib**)&a->data.v, make_key(atoi36("gmterf")));
|
add_key((attrib**)&a->data.v, atoi36("gmterf"));
|
||||||
a_add((attrib**)&a->data.v, make_key(atoi36("gmgate")));
|
add_key((attrib**)&a->data.v, atoi36("gmtele"));
|
||||||
a_add((attrib**)&a->data.v, make_key(atoi36("gmtele")));
|
add_key((attrib**)&a->data.v, atoi36("gmgive"));
|
||||||
a_add((attrib**)&a->data.v, make_key(atoi36("gmgive")));
|
add_key((attrib**)&a->data.v, atoi36("gmskil"));
|
||||||
a_add((attrib**)&a->data.v, make_key(atoi36("gmskil")));
|
add_key((attrib**)&a->data.v, atoi36("gmtake"));
|
||||||
a_add((attrib**)&a->data.v, make_key(atoi36("gmtake")));
|
add_key((attrib**)&a->data.v, atoi36("gmmsgr"));
|
||||||
a_add((attrib**)&a->data.v, make_key(atoi36("gmmsgr")));
|
add_key((attrib**)&a->data.v, atoi36("gmmsgu"));
|
||||||
a_add((attrib**)&a->data.v, make_key(atoi36("gmmsgu")));
|
add_key((attrib**)&a->data.v, atoi36("gmgate"));
|
||||||
|
|
||||||
a_add((attrib**)&a->data.v, make_atgmcreate(resource2item(r_silver)));
|
a_add((attrib**)&a->data.v, make_atgmcreate(resource2item(r_silver)));
|
||||||
|
|
||||||
|
@ -809,39 +809,3 @@ gm_addplane(int radius, unsigned int flags, const char * name)
|
||||||
}
|
}
|
||||||
return p;
|
return p;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef TEST_GM_COMMANDS
|
|
||||||
void
|
|
||||||
setup_gm_faction(void)
|
|
||||||
{
|
|
||||||
int i = atoi36("gms")-1;
|
|
||||||
faction * f = factions;
|
|
||||||
unit * newunit;
|
|
||||||
region * r = regions;
|
|
||||||
attrib * a;
|
|
||||||
|
|
||||||
do {
|
|
||||||
f = findfaction(++i);
|
|
||||||
} while (f);
|
|
||||||
|
|
||||||
f = (faction *) calloc(1, sizeof(faction));
|
|
||||||
f->no = i;
|
|
||||||
set_string(&f->email, "gms@eressea-pbem.de");
|
|
||||||
set_string(&f->passw, "geheim");
|
|
||||||
set_string(&f->name, "GMs");
|
|
||||||
f->alive = 1;
|
|
||||||
f->options |= (1 << O_REPORT);
|
|
||||||
f->options |= (1 << O_COMPUTER);
|
|
||||||
addlist(&factions, f);
|
|
||||||
|
|
||||||
a = a_add(&f->attribs, a_new(&at_permissions));
|
|
||||||
a_add((attrib**)&a->data.v, make_atgmcreate(&it_demonseye));
|
|
||||||
a_add((attrib**)&a->data.v, make_key(atoi36("gmtf")));
|
|
||||||
|
|
||||||
while (r && !r->land) r=r->next;
|
|
||||||
newunit = createunit(r, f, 1, RC_DAEMON);
|
|
||||||
set_string(&newunit->name, "Flamdring, Gott des Feuers");
|
|
||||||
set_money(newunit, 100);
|
|
||||||
fset(newunit, FL_ISNEW);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
|
@ -1064,9 +1064,7 @@ update_gms(void)
|
||||||
int k;
|
int k;
|
||||||
item_t i;
|
item_t i;
|
||||||
for (k=0;keys[k];++k) {
|
for (k=0;keys[k];++k) {
|
||||||
if (!find_key((attrib*)permissions->data.v, atoi36(keys[k]))) {
|
add_key((attrib**)&permissions->data.v, atoi36(keys[k]));
|
||||||
a_add((attrib**)&permissions->data.v, make_key(atoi36(keys[k])));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
for (i=I_GREATSWORD;i!=I_KEKS;++i) {
|
for (i=I_GREATSWORD;i!=I_KEKS;++i) {
|
||||||
attrib * a = a_find(permissions, &at_gmcreate);
|
attrib * a = a_find(permissions, &at_gmcreate);
|
||||||
|
@ -1940,30 +1938,6 @@ test_gmquest(void)
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if 0
|
|
||||||
static int
|
|
||||||
create_xe(void)
|
|
||||||
{
|
|
||||||
attrib *a;
|
|
||||||
plane * p = gm_addplane(4, PFL_NOCOORDS | PFL_NORECRUITS |
|
|
||||||
PFL_NOGIVE | PFL_NOATTACK | PFL_NOTERRAIN | PFL_NOMAGIC |
|
|
||||||
PFL_NOSTEALTH | PFL_NOTEACH | PFL_NOBUILD | PFL_NOFEED,
|
|
||||||
"Xontormia-Expreß");
|
|
||||||
region * center = findregion(p->minx+(p->maxx-p->minx)/2, p->miny+(p->maxy-p->miny)/2);
|
|
||||||
faction * f = gm_addfaction("abeer@gmx.de", p, center);
|
|
||||||
|
|
||||||
log_printf("Xe-Partei %s\n", factionname(f));
|
|
||||||
|
|
||||||
a = a_find(f->attribs, &at_permissions);
|
|
||||||
a_remove(&f->attribs, a);
|
|
||||||
a = a_add(&f->attribs, a_new(&at_permissions));
|
|
||||||
a_add((attrib**)&a->data.v, make_key(atoi36("gmterf")));
|
|
||||||
a_add((attrib**)&a->data.v, make_key(atoi36("gmmsgr")));
|
|
||||||
a_add((attrib**)&a->data.v, make_key(atoi36("gmmsgu")));
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define TEST_LOCALES 0
|
#define TEST_LOCALES 0
|
||||||
#if TEST_LOCALES
|
#if TEST_LOCALES
|
||||||
static void
|
static void
|
||||||
|
|
Loading…
Reference in New Issue