Fixes #58 - Game crash with AOE attacks
This commit is contained in:
parent
ef5cd4e244
commit
43ca8f4560
|
@ -128,7 +128,12 @@ damage_surroundings(Monster *m, RoomMatrix *rm)
|
||||||
for (Sint32 j = -1; j <= 1; ++j) {
|
for (Sint32 j = -1; j <= 1; ++j) {
|
||||||
if (i == 0 && j == 0)
|
if (i == 0 && j == 0)
|
||||||
continue;
|
continue;
|
||||||
RoomSpace *r = &rm->spaces[roomPos.x + i][roomPos.y + j];
|
|
||||||
|
Position matrixPos = POS(roomPos.x + i, roomPos.y + j);
|
||||||
|
if (!position_in_roommatrix(&matrixPos))
|
||||||
|
continue;
|
||||||
|
|
||||||
|
RoomSpace *r = &rm->spaces[matrixPos.x][matrixPos.y];
|
||||||
if (r->monster) {
|
if (r->monster) {
|
||||||
int dmg = stats_fight(&m->stats, &r->monster->stats);
|
int dmg = stats_fight(&m->stats, &r->monster->stats);
|
||||||
monster_hit(r->monster, dmg);
|
monster_hit(r->monster, dmg);
|
||||||
|
|
|
@ -879,7 +879,11 @@ skill_erupt(Skill *skill, SkillData *data)
|
||||||
if (i == 0 && j == 0)
|
if (i == 0 && j == 0)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
RoomSpace *r = &rm->spaces[playerMPos.x + i][playerMPos.y + j];
|
Position matrixPos = POS(playerMPos.x + i, playerMPos.y + j);
|
||||||
|
if (!position_in_roommatrix(&matrixPos))
|
||||||
|
continue;
|
||||||
|
|
||||||
|
RoomSpace *r = &rm->spaces[matrixPos.x][matrixPos.y];
|
||||||
if (r->monster) {
|
if (r->monster) {
|
||||||
player->stats.advantage = true;
|
player->stats.advantage = true;
|
||||||
int dmg = stats_fight(&player->stats, &r->monster->stats);
|
int dmg = stats_fight(&player->stats, &r->monster->stats);
|
||||||
|
|
Loading…
Reference in New Issue