forked from github/server
Mehrere Bugfixes die aus der vorangegangenen Aenderung resultierten.
Ausserdem: Bei falsch geschriebenen Befehlen (ZCHTE) wird der falsche Befehl in der Meldung ausgegeben.
This commit is contained in:
parent
ed70863843
commit
f1b26f0234
5 changed files with 42 additions and 115 deletions
|
@ -68,10 +68,8 @@ use_studypotion(struct unit * u, const struct item_type * itype, int amount, str
|
|||
static int
|
||||
use_speedsail(struct unit * u, const struct item_type * itype, int amount, struct order * ord)
|
||||
{
|
||||
struct plane * p = rplane(u->region);
|
||||
unused(amount);
|
||||
unused(itype);
|
||||
#ifdef SPEEDAIL_ENABLED
|
||||
struct plane * p = rplane(u->region);
|
||||
/* disabled because of abuse */
|
||||
if (p!=NULL) {
|
||||
ADDMSG(&u->faction->msgs, msg_feedback(u, ord, "use_realworld_only", ""));
|
||||
|
@ -94,6 +92,8 @@ use_speedsail(struct unit * u, const struct item_type * itype, int amount, struc
|
|||
}
|
||||
}
|
||||
#endif
|
||||
unused(amount);
|
||||
unused(itype);
|
||||
return EUNUSABLE;
|
||||
}
|
||||
/* END speedsail */
|
||||
|
|
|
@ -2548,85 +2548,6 @@ combatspell_cmd(unit * u, struct order * ord)
|
|||
return 0;
|
||||
}
|
||||
|
||||
static void
|
||||
instant_orders(void)
|
||||
{
|
||||
region *r;
|
||||
faction *f;
|
||||
|
||||
puts(" - Kontakte, Hilfe, Status, Kampfzauber, Texte, Bewachen (aus), Zeigen");
|
||||
|
||||
for (f = factions; f; f = f->next) {
|
||||
attrib *a;
|
||||
a = a_find(f->attribs, &at_showitem);
|
||||
while (a!=NULL && a->type==&at_showitem) {
|
||||
const item_type * itype = (const item_type *)a->data.v;
|
||||
const potion_type * ptype = resource2potion(itype->rtype);
|
||||
attrib * an = a->next;
|
||||
if (ptype!=NULL) {
|
||||
/* potions werden separat behandelt */
|
||||
display_item(f, NULL, (const item_type *)a->data.v);
|
||||
a_remove(&f->attribs, a);
|
||||
}
|
||||
a = an;
|
||||
}
|
||||
}
|
||||
|
||||
for (r = regions; r; r = r->next) {
|
||||
unit * u;
|
||||
for (u = r->units; u; u = u->next) {
|
||||
order * ord;
|
||||
freset(u, UFL_MOVED); /* reset, because it was saved in the datafile (monsters!) */
|
||||
for (ord = u->orders; ord; ord = ord->next) {
|
||||
switch (get_keyword(ord)) {
|
||||
case K_QUIT:
|
||||
quit_cmd(u, ord);
|
||||
break;
|
||||
case K_URSPRUNG:
|
||||
origin_cmd(u, ord);
|
||||
break;
|
||||
case K_ALLY:
|
||||
ally_cmd(u, ord);
|
||||
break;
|
||||
case K_PREFIX:
|
||||
prefix_cmd(u, ord);
|
||||
break;
|
||||
case K_SYNONYM:
|
||||
synonym_cmd(u, ord);
|
||||
break;
|
||||
case K_SETSTEALTH:
|
||||
setstealth_cmd(u, ord);
|
||||
break;
|
||||
#ifdef KARMA_MODULE
|
||||
case K_WEREWOLF:
|
||||
setwere_cmd(u, ord);
|
||||
break;
|
||||
#endif /* KARMA_MODULE */
|
||||
case K_STATUS:
|
||||
/* KAEMPFE [ NICHT | AGGRESSIV | DEFENSIV | HINTEN | FLIEHE ] */
|
||||
status_cmd(u, ord);
|
||||
break;
|
||||
case K_COMBAT:
|
||||
/* KAMPFZAUBER [[STUFE n] "<Spruchname>"] [NICHT] */
|
||||
combatspell_cmd(u, ord);
|
||||
break;
|
||||
case K_DISPLAY:
|
||||
display_cmd(u, ord);
|
||||
break;
|
||||
case K_NAME:
|
||||
name_cmd(u, ord);
|
||||
break;
|
||||
case K_GUARD:
|
||||
guard_off_cmd(u, ord);
|
||||
break;
|
||||
case K_RESHOW:
|
||||
reshow_cmd(u, ord);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
/* ------------------------------------------------------------- */
|
||||
/* Beachten: einige Monster sollen auch unbewaffent die Region bewachen
|
||||
* können */
|
||||
|
@ -3400,6 +3321,9 @@ setdefaults(unit *u)
|
|||
* werden. Da Handel erst nach anderen langen Befehlen kommt,
|
||||
* muß das vorher abgefangen werden. Wir merken uns also
|
||||
* hier, ob die Einheit handelt. */
|
||||
case NOKEYWORD:
|
||||
cmistake(u, ord, 22, MSG_EVENT);
|
||||
break;
|
||||
case K_BUY:
|
||||
case K_SELL:
|
||||
/* Wenn die Einheit handelt, muß der Default-Befehl gelöscht
|
||||
|
@ -3648,6 +3572,7 @@ update_spells(void)
|
|||
for(r=regions; r; r=r->next) {
|
||||
unit *u;
|
||||
for(u=r->units;u;u=u->next) {
|
||||
if (u->faction!=NULL && u->number>0) {
|
||||
sc_mage *m = get_mage(u);
|
||||
if (u->faction->no != MONSTER_FACTION && m != NULL) {
|
||||
if (m->magietyp == M_GRAU) continue;
|
||||
|
@ -3655,6 +3580,7 @@ update_spells(void)
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
@ -3880,7 +3806,7 @@ process(void)
|
|||
if (pglobal==NULL || pglobal->priority!=prio) continue;
|
||||
|
||||
for (r = regions; r; r = r->next) {
|
||||
unit **up;
|
||||
unit *u;
|
||||
processor *pregion = pglobal;
|
||||
|
||||
while (pregion && pregion->priority==prio && pregion->type==PR_REGION) {
|
||||
|
@ -3889,8 +3815,7 @@ process(void)
|
|||
}
|
||||
if (pregion==NULL || pregion->priority!=prio) continue;
|
||||
|
||||
for (up=&r->units;*up;) {
|
||||
unit * u = *up;
|
||||
for (u=r->units;u;u=u->next) {
|
||||
processor *porder, *punit = pregion;
|
||||
|
||||
while (punit && punit->priority==prio && punit->type==PR_UNIT) {
|
||||
|
@ -3912,8 +3837,6 @@ process(void)
|
|||
}
|
||||
porder = porder->next;
|
||||
}
|
||||
assert(*up==u);
|
||||
up=&u->next;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -4095,6 +4018,7 @@ processorders (void)
|
|||
|
||||
puts(" - Attribute altern");
|
||||
ageing();
|
||||
remove_empty_units();
|
||||
|
||||
#ifdef WORMHOLE_MODULE
|
||||
create_wormholes();
|
||||
|
|
|
@ -730,6 +730,7 @@ learn_cmd(unit * u, order * ord)
|
|||
}
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
@ -464,7 +464,8 @@ write_order(const order * ord, const struct locale * lang, char * buffer, size_t
|
|||
} else {
|
||||
keyword_t kwd = ORD_KEYWORD(ord);
|
||||
if (kwd==NOKEYWORD) {
|
||||
buffer[0]=0;
|
||||
const char * text = ORD_STRING(ord);
|
||||
strlcpy(buffer, text, size);
|
||||
} else {
|
||||
get_command(ord, buffer, size);
|
||||
}
|
||||
|
|
|
@ -75,10 +75,11 @@ do_shock(unit *u, const char *reason)
|
|||
if (strcmp(reason, "trigger")==0) {
|
||||
remove_familiar(u);
|
||||
}
|
||||
|
||||
if (u->faction!=NULL) {
|
||||
ADDMSG(&u->faction->msgs, msg_message("shock",
|
||||
"mage reason", u, strdup(reason)));
|
||||
}
|
||||
}
|
||||
|
||||
static int
|
||||
shock_handle(trigger * t, void * data)
|
||||
|
|
Loading…
Reference in a new issue