Skip to content

Commit fe0e82c

Browse files
committed
fix 923
1 parent cbb25c0 commit fe0e82c

2 files changed

Lines changed: 3 additions & 2 deletions

File tree

‎src/Battlescape/ProjectileFlyBState.cpp‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -703,15 +703,15 @@ void ProjectileFlyBState::performMeleeAttack()
703703
_unit->setCache(0);
704704
_parent->getMap()->cacheUnit(_unit);
705705
// and we have a lift-off
706-
if (_ammo->getRules()->getMeleeAttackSound() != -1)
706+
if (_ammo && _ammo->getRules()->getMeleeAttackSound() != -1)
707707
{
708708
_parent->getResourcePack()->getSound("BATTLE.CAT", _ammo->getRules()->getMeleeAttackSound())->play();
709709
}
710710
else if (_action.weapon->getRules()->getMeleeAttackSound() != -1)
711711
{
712712
_parent->getResourcePack()->getSound("BATTLE.CAT", _action.weapon->getRules()->getMeleeAttackSound())->play();
713713
}
714-
if (!_parent->getSave()->getDebugMode() && _action.type != BA_LAUNCH && _ammo->spendBullet() == false)
714+
if (!_parent->getSave()->getDebugMode() && _action.weapon->getRules()->getBattleType() == BT_MELEE && _ammo && _ammo->spendBullet() == false)
715715
{
716716
_parent->getSave()->removeItem(_ammo);
717717
_action.weapon->setAmmoItem(0);

‎src/Engine/CrossPlatform.cpp‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -541,6 +541,7 @@ std::vector<std::string> getFolderContents(const std::string &path, const std::s
541541
files.push_back(file);
542542
}
543543
closedir(dp);
544+
std::sort(files.begin(), files.end());
544545
return files;
545546
}
546547

0 commit comments

Comments
 (0)