mirror of https://github.com/OpenTTD/OpenTTD.git
(svn r939) -Fix: Fixed compiler errors
This commit is contained in:
parent
e56c3cddd8
commit
0434287ef8
3
engine.c
3
engine.c
|
@ -545,8 +545,9 @@ static void DoTriggerVehicle(Vehicle *veh, enum VehicleTrigger trigger, byte bas
|
||||||
rsg = TriggerVehicleSpriteGroup(&_engine_custom_sprites[veh->engine_type][29], veh,
|
rsg = TriggerVehicleSpriteGroup(&_engine_custom_sprites[veh->engine_type][29], veh,
|
||||||
(resolve_callback) TriggerVehicleSpriteGroup);
|
(resolve_callback) TriggerVehicleSpriteGroup);
|
||||||
}
|
}
|
||||||
|
new_random_bits = Random();
|
||||||
veh->random_bits &= ~_vsg_bits_to_reseed;
|
veh->random_bits &= ~_vsg_bits_to_reseed;
|
||||||
veh->random_bits |= (first ? (new_random_bits = Random()) : base_random_bits) & _vsg_bits_to_reseed;
|
veh->random_bits |= (first ? new_random_bits : base_random_bits) & _vsg_bits_to_reseed;
|
||||||
|
|
||||||
switch (trigger) {
|
switch (trigger) {
|
||||||
case VEHICLE_TRIGGER_NEW_CARGO:
|
case VEHICLE_TRIGGER_NEW_CARGO:
|
||||||
|
|
6
newgrf.c
6
newgrf.c
|
@ -855,6 +855,7 @@ static bool StationChangeInfo(uint stid, int numinfo, int prop, byte **bufp, int
|
||||||
stat->platforms[l] = number;
|
stat->platforms[l] = number;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
p = 0;
|
||||||
layout = malloc(length * number);
|
layout = malloc(length * number);
|
||||||
for (l = 0; l < length; l++)
|
for (l = 0; l < length; l++)
|
||||||
for (p = 0; p < number; p++)
|
for (p = 0; p < number; p++)
|
||||||
|
@ -862,6 +863,7 @@ static bool StationChangeInfo(uint stid, int numinfo, int prop, byte **bufp, int
|
||||||
|
|
||||||
l--;
|
l--;
|
||||||
p--;
|
p--;
|
||||||
|
assert(p >= 0);
|
||||||
free(stat->layouts[l][p]);
|
free(stat->layouts[l][p]);
|
||||||
stat->layouts[l][p] = layout;
|
stat->layouts[l][p] = layout;
|
||||||
}
|
}
|
||||||
|
@ -949,7 +951,7 @@ static void VehicleChangeInfo(byte *buf, int len)
|
||||||
uint8 numprops;
|
uint8 numprops;
|
||||||
uint8 numinfo;
|
uint8 numinfo;
|
||||||
byte engine;
|
byte engine;
|
||||||
EngineInfo *ei;
|
EngineInfo *ei = NULL;
|
||||||
|
|
||||||
if (len == 1) {
|
if (len == 1) {
|
||||||
DEBUG(grf, 8) ("Silently ignoring one-byte special sprite 0x00.");
|
DEBUG(grf, 8) ("Silently ignoring one-byte special sprite 0x00.");
|
||||||
|
@ -972,6 +974,8 @@ static void VehicleChangeInfo(byte *buf, int len)
|
||||||
|
|
||||||
if (feature != GSF_STATION)
|
if (feature != GSF_STATION)
|
||||||
ei = &_engine_info[engine + _vehshifts[feature]];
|
ei = &_engine_info[engine + _vehshifts[feature]];
|
||||||
|
/* XXX - Should there not be a check to see if 'ei' is NULL
|
||||||
|
when it is used in the switch below?? -- TrueLight */
|
||||||
|
|
||||||
buf += 5;
|
buf += 5;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue