added locking to dragon hoards
This commit is contained in:
@ -1,10 +1,12 @@
|
||||
#include "dragon.h"
|
||||
|
||||
#include "../constants.h"
|
||||
#include "../level.h"
|
||||
|
||||
dragon::dragon(RNG *rng, const feature enabled_features, const position &pos,
|
||||
const int gen_room_num):
|
||||
enemy_base{rng, enabled_features, DRAGON, pos, gen_room_num, "D"} {}
|
||||
const int gen_room_num, const position &guards):
|
||||
enemy_base{rng, enabled_features, DRAGON, pos, gen_room_num, "D"},
|
||||
guards{guards} {}
|
||||
|
||||
const char *dragon::get_race_name() const {
|
||||
return "Dragon";
|
||||
@ -18,5 +20,9 @@ long_result dragon::act(level *lvl, character *pc, bool hostile) {
|
||||
}
|
||||
|
||||
int dragon::dies(level *lvl) {
|
||||
for (auto &g : lvl->get_glist())
|
||||
if (g.get_pos() == guards)
|
||||
g.unlock();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
Reference in New Issue
Block a user