mirror of
https://github.com/OpenTTD/OpenTTD
synced 2026-01-24 12:44:10 +01:00
(svn r22992) [1.1] -Backport from trunk:
- Fix: [NewGRF] Crash when accessing vehicle var 44 for a non-front aircraft [FS#4781] (r22946) - Fix: Calculate the size of the start/stop vehicle button correctly (r22941) - Fix: [OSX] Various MacOSX 10.7 issues causing OpenTTD to not work [FS#4751] (r22921, r22895, r22893, r22889) - Fix: [NewGRF] Properties for feature 0x05 were not zeroed for each NewGRF, thus waterfeatures could glitch when the properties were set by a previous NewGRF and the NewGRF assumed the properties to be unmodified (r22918)
This commit is contained in:
@@ -1435,15 +1435,15 @@ static ChangeInfoResult CanalChangeInfo(uint id, int numinfo, int prop, ByteRead
|
||||
}
|
||||
|
||||
for (int i = 0; i < numinfo; i++) {
|
||||
WaterFeature *wf = &_water_feature[id + i];
|
||||
CanalProperties *cp = &_cur_grffile->canal_local_properties[id + i];
|
||||
|
||||
switch (prop) {
|
||||
case 0x08:
|
||||
wf->callback_mask = buf->ReadByte();
|
||||
cp->callback_mask = buf->ReadByte();
|
||||
break;
|
||||
|
||||
case 0x09:
|
||||
wf->flags = buf->ReadByte();
|
||||
cp->flags = buf->ReadByte();
|
||||
break;
|
||||
|
||||
default:
|
||||
@@ -7519,6 +7519,17 @@ static void CalculateRefitMasks()
|
||||
}
|
||||
}
|
||||
|
||||
/** Set to use the correct action0 properties for each canal feature */
|
||||
static void FinaliseCanals()
|
||||
{
|
||||
for (uint i = 0; i < CF_END; i++) {
|
||||
if (_water_feature[i].grffile != NULL) {
|
||||
_water_feature[i].callback_mask = _water_feature[i].grffile->canal_local_properties[i].callback_mask;
|
||||
_water_feature[i].flags = _water_feature[i].grffile->canal_local_properties[i].flags;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/** Check for invalid engines */
|
||||
static void FinaliseEngineArray()
|
||||
{
|
||||
@@ -8204,6 +8215,9 @@ static void AfterLoadGRFs()
|
||||
/* Polish engines */
|
||||
FinaliseEngineArray();
|
||||
|
||||
/* Set the actually used Canal properties */
|
||||
FinaliseCanals();
|
||||
|
||||
/* Set the block size in the depot windows based on vehicle sprite sizes */
|
||||
InitDepotWindowBlockSizes();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user