1
0
Fork 0

Fix #14125, 828e808444: NewGRF sounds were not loaded. (#14130)

NewGRF Action 11 should be handled in both INIT and ACTIVATION stages for sounds to be loaded.

Additionally the Action 0 feature test failed due to offsets involved.
pull/14132/head
Peter Nelson 2025-04-27 16:20:38 +01:00 committed by GitHub
parent b9667ec3d1
commit 7bbf380931
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 2 additions and 1 deletions

View File

@ -26,6 +26,7 @@
static ChangeInfoResult SoundEffectChangeInfo(uint first, uint last, int prop, ByteReader &buf)
{
ChangeInfoResult ret = CIR_SUCCESS;
if (first == last) return ret;
if (_cur_gps.grffile->sound_offset == 0) {
GrfMsg(1, "SoundEffectChangeInfo: No effects defined, skipping");

View File

@ -175,6 +175,6 @@ static void SkipAct11(ByteReader &buf)
template <> void GrfActionHandler<0x11>::FileScan(ByteReader &buf) { SkipAct11(buf); }
template <> void GrfActionHandler<0x11>::SafetyScan(ByteReader &buf) { GRFUnsafe(buf); }
template <> void GrfActionHandler<0x11>::LabelScan(ByteReader &buf) { SkipAct11(buf); }
template <> void GrfActionHandler<0x11>::Init(ByteReader &buf) { SkipAct11(buf); }
template <> void GrfActionHandler<0x11>::Init(ByteReader &buf) { GRFSound(buf); }
template <> void GrfActionHandler<0x11>::Reserve(ByteReader &buf) { SkipAct11(buf); }
template <> void GrfActionHandler<0x11>::Activation(ByteReader &buf) { GRFSound(buf); }