forked from github/server
- Temporärer Fix für GIB TEMP, nochmal ansehen!
This commit is contained in:
parent
89d902b132
commit
e763673cbd
|
@ -2136,12 +2136,16 @@ attack(battle *b, troop ta, const att *a)
|
||||||
ta.fighter->action_counter++;
|
ta.fighter->action_counter++;
|
||||||
}
|
}
|
||||||
if (td.fighter->unit->ship) {
|
if (td.fighter->unit->ship) {
|
||||||
|
if(a_find(td.fighter->unit->ship->attribs, &at_nodestroy) == NULL) {
|
||||||
td.fighter->unit->ship->damage += DAMAGE_SCALE * dice_rand(a->data.dice);
|
td.fighter->unit->ship->damage += DAMAGE_SCALE * dice_rand(a->data.dice);
|
||||||
|
}
|
||||||
} else if (td.fighter->unit->building) {
|
} else if (td.fighter->unit->building) {
|
||||||
|
if(a_find(td.fighter->unit->building->attribs, &at_nodestroy) == NULL) {
|
||||||
damage_building(b, td.fighter->unit->building,
|
damage_building(b, td.fighter->unit->building,
|
||||||
dice_rand(a->data.dice));
|
dice_rand(a->data.dice));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/* Der letzte Katapultschütze setzt die
|
/* Der letzte Katapultschütze setzt die
|
||||||
* Ladezeit neu und generiert die Meldung. */
|
* Ladezeit neu und generiert die Meldung. */
|
||||||
|
|
|
@ -370,6 +370,12 @@ destroy(region * r, unit * u, const char * cmd)
|
||||||
|
|
||||||
if (u->building) {
|
if (u->building) {
|
||||||
building *b = u->building;
|
building *b = u->building;
|
||||||
|
|
||||||
|
if(a_find(b->attribs, &at_nodestroy)) {
|
||||||
|
cmistake(u, cmd, 14, MSG_EVENT);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
con = b->type->construction;
|
con = b->type->construction;
|
||||||
size = b->size;
|
size = b->size;
|
||||||
|
@ -394,6 +400,12 @@ destroy(region * r, unit * u, const char * cmd)
|
||||||
}
|
}
|
||||||
} else if (u->ship) {
|
} else if (u->ship) {
|
||||||
sh = u->ship;
|
sh = u->ship;
|
||||||
|
|
||||||
|
if(a_find(sh->attribs, &at_nodestroy)) {
|
||||||
|
cmistake(u, cmd, 14, MSG_EVENT);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
con = sh->type->construction;
|
con = sh->type->construction;
|
||||||
size = (sh->size * DAMAGE_SCALE - sh->damage) / DAMAGE_SCALE;
|
size = (sh->size * DAMAGE_SCALE - sh->damage) / DAMAGE_SCALE;
|
||||||
|
|
|
@ -15,6 +15,7 @@
|
||||||
#include <config.h>
|
#include <config.h>
|
||||||
#include "eressea.h"
|
#include "eressea.h"
|
||||||
#include "building.h"
|
#include "building.h"
|
||||||
|
#include "attrib.h"
|
||||||
|
|
||||||
/* kernel includes */
|
/* kernel includes */
|
||||||
#include "item.h"
|
#include "item.h"
|
||||||
|
@ -39,6 +40,14 @@
|
||||||
/* attributes includes */
|
/* attributes includes */
|
||||||
#include <attributes/matmod.h>
|
#include <attributes/matmod.h>
|
||||||
|
|
||||||
|
attrib_type at_nodestroy = {
|
||||||
|
"nodestroy",
|
||||||
|
NULL, NULL, NULL,
|
||||||
|
a_writedefault,
|
||||||
|
a_readdefault,
|
||||||
|
ATF_UNIQUE
|
||||||
|
};
|
||||||
|
|
||||||
building_typelist *buildingtypes;
|
building_typelist *buildingtypes;
|
||||||
|
|
||||||
const building_type *
|
const building_type *
|
||||||
|
|
|
@ -139,6 +139,8 @@ extern struct building *findbuilding(int n);
|
||||||
|
|
||||||
extern struct unit * buildingowner(const struct region * r, const struct building * b);
|
extern struct unit * buildingowner(const struct region * r, const struct building * b);
|
||||||
|
|
||||||
|
extern attrib_type at_nodestroy;
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -1551,11 +1551,15 @@ getunit(const region * r, const faction * f)
|
||||||
|
|
||||||
if (n < 0) return 0;
|
if (n < 0) return 0;
|
||||||
|
|
||||||
|
return findunitr(r, n);
|
||||||
|
|
||||||
|
/* && u2->number>0 verhindert GIB TEMP u.ä.!
|
||||||
for (u2 = r->units; u2; u2 = u2->next) {
|
for (u2 = r->units; u2; u2 = u2->next) {
|
||||||
if (u2->no == n && u2->number>0) {
|
if (u2->no == n && u2->number>0) {
|
||||||
return u2;
|
return u2;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -3122,6 +3126,7 @@ attrib_init(void)
|
||||||
at_register(&at_wdwpyramid);
|
at_register(&at_wdwpyramid);
|
||||||
#endif
|
#endif
|
||||||
at_register(&at_speedup);
|
at_register(&at_speedup);
|
||||||
|
at_register(&at_nodestroy);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
Loading…
Reference in New Issue