Permalink
Browse files

Fix when entering battle with empty autocannon #383

There is no payloadType for empty autocannon so we can't get damage_type
of weapon.
  • Loading branch information...
Jarskih committed Oct 11, 2018
1 parent e07568c commit 19527ef3b9e1ac762da53e4ae8a45316c33d45a0
Showing with 2 additions and 2 deletions.
  1. +2 −2 game/state/battle/battle.cpp
@@ -3531,7 +3531,7 @@ void Battle::loadImagePacks(GameState &state)
if (imagePacks.find(packName) == imagePacks.end())
imagePacks.insert(packName);
}
if (!brainsuckerFound && ae->getPayloadType()->damage_type &&
if (!brainsuckerFound && ae->getPayloadType() && ae->getPayloadType()->damage_type &&
ae->getPayloadType()->damage_type->effectType ==
DamageType::EffectType::Brainsucker)
{
@@ -3647,7 +3647,7 @@ void Battle::loadAnimationPacks(GameState &state)
{
for (auto &e : u.second->agent->equipment)
{
if (e->getPayloadType()->damage_type &&
if (e->getPayloadType() && e->getPayloadType()->damage_type &&
e->getPayloadType()->damage_type->effectType ==
DamageType::EffectType::Brainsucker)
{

0 comments on commit 19527ef

Please sign in to comment.