- Temporärer Fix für GIB TEMP, nochmal ansehen!

This commit is contained in:
Christian Schlittchen 2004-06-13 10:21:48 +00:00
parent 89d902b132
commit e763673cbd
5 changed files with 35 additions and 3 deletions

View File

@ -2136,10 +2136,14 @@ attack(battle *b, troop ta, const att *a)
ta.fighter->action_counter++;
}
if (td.fighter->unit->ship) {
td.fighter->unit->ship->damage += DAMAGE_SCALE * dice_rand(a->data.dice);
if(a_find(td.fighter->unit->ship->attribs, &at_nodestroy) == NULL) {
td.fighter->unit->ship->damage += DAMAGE_SCALE * dice_rand(a->data.dice);
}
} else if (td.fighter->unit->building) {
damage_building(b, td.fighter->unit->building,
dice_rand(a->data.dice));
if(a_find(td.fighter->unit->building->attribs, &at_nodestroy) == NULL) {
damage_building(b, td.fighter->unit->building,
dice_rand(a->data.dice));
}
}
}

View File

@ -370,6 +370,12 @@ destroy(region * r, unit * u, const char * cmd)
if (u->building) {
building *b = u->building;
if(a_find(b->attribs, &at_nodestroy)) {
cmistake(u, cmd, 14, MSG_EVENT);
return;
}
#if 0
con = b->type->construction;
size = b->size;
@ -394,6 +400,12 @@ destroy(region * r, unit * u, const char * cmd)
}
} else if (u->ship) {
sh = u->ship;
if(a_find(sh->attribs, &at_nodestroy)) {
cmistake(u, cmd, 14, MSG_EVENT);
return;
}
#if 0
con = sh->type->construction;
size = (sh->size * DAMAGE_SCALE - sh->damage) / DAMAGE_SCALE;

View File

@ -15,6 +15,7 @@
#include <config.h>
#include "eressea.h"
#include "building.h"
#include "attrib.h"
/* kernel includes */
#include "item.h"
@ -39,6 +40,14 @@
/* attributes includes */
#include <attributes/matmod.h>
attrib_type at_nodestroy = {
"nodestroy",
NULL, NULL, NULL,
a_writedefault,
a_readdefault,
ATF_UNIQUE
};
building_typelist *buildingtypes;
const building_type *

View File

@ -139,6 +139,8 @@ extern struct building *findbuilding(int n);
extern struct unit * buildingowner(const struct region * r, const struct building * b);
extern attrib_type at_nodestroy;
#ifdef __cplusplus
}
#endif

View File

@ -1551,11 +1551,15 @@ getunit(const region * r, const faction * f)
if (n < 0) return 0;
return findunitr(r, n);
/* && u2->number>0 verhindert GIB TEMP u.ä.!
for (u2 = r->units; u2; u2 = u2->next) {
if (u2->no == n && u2->number>0) {
return u2;
}
}
*/
return 0;
}
@ -3122,6 +3126,7 @@ attrib_init(void)
at_register(&at_wdwpyramid);
#endif
at_register(&at_speedup);
at_register(&at_nodestroy);
}
void