game: begin to use the get_terrain method, ...

This commit is contained in:
ALONSO Laurent
2021-10-19 10:01:25 +02:00
committed by Celtic Minstrel
parent 1b7dcaab1f
commit 8951d0efc1
19 changed files with 171 additions and 206 deletions

View File

@@ -746,8 +746,9 @@ void move_sound(ter_num_t ter,short step){
static bool on_swamp = false;
eTerSpec spec;
spec = univ.scenario.ter_types[ter].special;
eStepSnd snd = univ.scenario.ter_types[ter].step_sound;
auto const &terrain=univ.get_terrain(ter);
spec = terrain.special;
eStepSnd snd = terrain.step_sound;
// if on swamp don't play squish sound : BoE legacy behavior, can be removed safely
if(snd == eStepSnd::SPLASH && !flying() && univ.party.in_boat < 0){
@@ -761,7 +762,7 @@ void move_sound(ter_num_t ter,short step){
play_sound(48); //play boat sound
} else if(!monsters_going && !is_combat() && (univ.party.in_horse >= 0)) {
play_sound(85); //so play horse sound
} else switch(univ.scenario.ter_types[ter].step_sound){
} else switch(terrain.step_sound){
case eStepSnd::SQUISH:
play_sound(55);
break;