mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-07-04 11:34:22 +01:00
(svn r22452) -Fix (r18708): Zero register 0x100 as specified before resolving custom station foundations.
This commit is contained in:
parent
a63b22991d
commit
930d0c9702
@ -35,6 +35,17 @@ static inline uint32 GetRegister(uint i)
|
|||||||
return _temp_store.Get(i);
|
return _temp_store.Get(i);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Clears the value of a so-called newgrf "register".
|
||||||
|
* @param i index of the register
|
||||||
|
* @pre i < 0x110
|
||||||
|
*/
|
||||||
|
static inline void ClearRegister(uint i)
|
||||||
|
{
|
||||||
|
extern TemporaryStorageArray<int32, 0x110> _temp_store;
|
||||||
|
_temp_store.Store(i, 0);
|
||||||
|
}
|
||||||
|
|
||||||
/* List of different sprite group types */
|
/* List of different sprite group types */
|
||||||
enum SpriteGroupType {
|
enum SpriteGroupType {
|
||||||
SGT_REAL,
|
SGT_REAL,
|
||||||
|
@ -613,6 +613,7 @@ SpriteID GetCustomStationFoundationRelocation(const StationSpec *statspec, const
|
|||||||
NewStationResolver(&object, statspec, st, tile);
|
NewStationResolver(&object, statspec, st, tile);
|
||||||
object.callback_param1 = 2; // Indicate we are resolving the foundation sprites
|
object.callback_param1 = 2; // Indicate we are resolving the foundation sprites
|
||||||
|
|
||||||
|
ClearRegister(0x100);
|
||||||
group = ResolveStation(&object);
|
group = ResolveStation(&object);
|
||||||
if (group == NULL || group->type != SGT_RESULT) return 0;
|
if (group == NULL || group->type != SGT_RESULT) return 0;
|
||||||
return group->GetResult() + GetRegister(0x100);
|
return group->GetResult() + GetRegister(0x100);
|
||||||
|
Loading…
Reference in New Issue
Block a user