mirror of https://github.com/OpenTTD/OpenTTD.git
(svn r1402) Trim trailing whitespace
This commit is contained in:
parent
2c9cd8f68c
commit
8b7c1e94e1
|
@ -32,7 +32,7 @@
|
||||||
# define STDIN 0 /* file descriptor for standard input */
|
# define STDIN 0 /* file descriptor for standard input */
|
||||||
#endif
|
#endif
|
||||||
#ifdef __MORPHOS__
|
#ifdef __MORPHOS__
|
||||||
/* voids the fork, option will be disabled for morphos build anyway, because MorphOS
|
/* voids the fork, option will be disabled for morphos build anyway, because MorphOS
|
||||||
* doesn't support forking (could only implemented with lots of code changes here).
|
* doesn't support forking (could only implemented with lots of code changes here).
|
||||||
*/
|
*/
|
||||||
int morphos_dummy_fork() { return -1; }
|
int morphos_dummy_fork() { return -1; }
|
||||||
|
|
4
engine.c
4
engine.c
|
@ -119,7 +119,7 @@ void AddTypeToEngines()
|
||||||
{
|
{
|
||||||
Engine *e;
|
Engine *e;
|
||||||
uint32 counter = 0;
|
uint32 counter = 0;
|
||||||
|
|
||||||
for(e=_engines; e != endof(_engines); e++, counter++) {
|
for(e=_engines; e != endof(_engines); e++, counter++) {
|
||||||
|
|
||||||
e->type = VEH_Train;
|
e->type = VEH_Train;
|
||||||
|
@ -187,7 +187,7 @@ void StartupEngines()
|
||||||
e->flags |= ENGINE_AVAILABLE;
|
e->flags |= ENGINE_AVAILABLE;
|
||||||
e->player_avail = 0;
|
e->player_avail = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* This sets up type for the engine
|
/* This sets up type for the engine
|
||||||
It is needed if you want to ask the engine what type it is
|
It is needed if you want to ask the engine what type it is
|
||||||
It should hopefully be the same as when you ask a vehicle what it is
|
It should hopefully be the same as when you ask a vehicle what it is
|
||||||
|
|
2
fileio.c
2
fileio.c
|
@ -110,7 +110,7 @@ void FioOpenFile(int slot, const char *filename)
|
||||||
for(s=buf + strlen(_path.data_dir) - 1; *s != 0; s++)
|
for(s=buf + strlen(_path.data_dir) - 1; *s != 0; s++)
|
||||||
*s = tolower(*s);
|
*s = tolower(*s);
|
||||||
f = fopen(buf, "rb");
|
f = fopen(buf, "rb");
|
||||||
|
|
||||||
#if defined SECOND_DATA_DIR
|
#if defined SECOND_DATA_DIR
|
||||||
// tries in the 2nd data directory
|
// tries in the 2nd data directory
|
||||||
if (f == NULL) {
|
if (f == NULL) {
|
||||||
|
|
4
gfx.c
4
gfx.c
|
@ -1507,7 +1507,7 @@ void DoPaletteAnimations()
|
||||||
/* Amount of colors to be rotated.
|
/* Amount of colors to be rotated.
|
||||||
* A few more for the DOS palette, because the water colors are
|
* A few more for the DOS palette, because the water colors are
|
||||||
* 245-254 for DOS and 217-226 for Windows. */
|
* 245-254 for DOS and 217-226 for Windows. */
|
||||||
int c = _use_dos_palette?38:28;
|
int c = _use_dos_palette?38:28;
|
||||||
int j;
|
int j;
|
||||||
int i;
|
int i;
|
||||||
const ExtraPaletteValues *ev = &_extra_palette_values;
|
const ExtraPaletteValues *ev = &_extra_palette_values;
|
||||||
|
@ -1594,7 +1594,7 @@ void DoPaletteAnimations()
|
||||||
j+=3;
|
j+=3;
|
||||||
if (j == 15) j = 0;
|
if (j == 15) j = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Glittery water DOS
|
// Glittery water DOS
|
||||||
s = ev->b;
|
s = ev->b;
|
||||||
if (_opt.landscape == LT_CANDY) s = ev->bc;
|
if (_opt.landscape == LT_CANDY) s = ev->bc;
|
||||||
|
|
2
md5.h
2
md5.h
|
@ -71,7 +71,7 @@ typedef struct md5_state_s {
|
||||||
} md5_state_t;
|
} md5_state_t;
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C"
|
extern "C"
|
||||||
{
|
{
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
2
misc.c
2
misc.c
|
@ -189,7 +189,7 @@ void InitializeGame()
|
||||||
_autoreplace_array[i] = i;
|
_autoreplace_array[i] = i;
|
||||||
|
|
||||||
AddTypeToEngines(); // make sure all engines have a type
|
AddTypeToEngines(); // make sure all engines have a type
|
||||||
|
|
||||||
SetObjectToPlace(1, 0, 0, 0);
|
SetObjectToPlace(1, 0, 0, 0);
|
||||||
|
|
||||||
_pause = 0;
|
_pause = 0;
|
||||||
|
|
14
os2.c
14
os2.c
|
@ -56,7 +56,7 @@ static DIR *my_opendir(char *path, char *file)
|
||||||
{
|
{
|
||||||
char paths[MAX_PATH];
|
char paths[MAX_PATH];
|
||||||
|
|
||||||
append_path(paths, path, file);
|
append_path(paths, path, file);
|
||||||
return opendir(paths);
|
return opendir(paths);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -179,7 +179,7 @@ FiosItem *FiosGetSavegameList(int *num, int mode)
|
||||||
{
|
{
|
||||||
_dos_setdrive(disk, &total);
|
_dos_setdrive(disk, &total);
|
||||||
_dos_getdrive(&disk2);
|
_dos_getdrive(&disk2);
|
||||||
|
|
||||||
if (disk == disk2)
|
if (disk == disk2)
|
||||||
{
|
{
|
||||||
fios = FiosAlloc();
|
fios = FiosAlloc();
|
||||||
|
@ -299,7 +299,7 @@ FiosItem *FiosGetScenarioList(int *num, int mode)
|
||||||
{
|
{
|
||||||
_dos_setdrive(disk, &total);
|
_dos_setdrive(disk, &total);
|
||||||
_dos_getdrive(&disk2);
|
_dos_getdrive(&disk2);
|
||||||
|
|
||||||
if (disk == disk2)
|
if (disk == disk2)
|
||||||
{
|
{
|
||||||
fios = FiosAlloc();
|
fios = FiosAlloc();
|
||||||
|
@ -384,7 +384,7 @@ StringID FiosGetDescText(const char **path)
|
||||||
{
|
{
|
||||||
struct diskfree_t free;
|
struct diskfree_t free;
|
||||||
char drive;
|
char drive;
|
||||||
|
|
||||||
*path = _fios_path;
|
*path = _fios_path;
|
||||||
drive = *path[0] - 'A'+1;
|
drive = *path[0] - 'A'+1;
|
||||||
|
|
||||||
|
@ -486,7 +486,7 @@ void ShowInfo(const char *str)
|
||||||
HAB hab;
|
HAB hab;
|
||||||
HMQ hmq;
|
HMQ hmq;
|
||||||
ULONG rc;
|
ULONG rc;
|
||||||
|
|
||||||
// init PM env.
|
// init PM env.
|
||||||
hmq = WinCreateMsgQueue((hab = WinInitialize(0)), 0);
|
hmq = WinCreateMsgQueue((hab = WinInitialize(0)), 0);
|
||||||
|
|
||||||
|
@ -503,7 +503,7 @@ void ShowOSErrorBox(const char *buf)
|
||||||
HAB hab;
|
HAB hab;
|
||||||
HMQ hmq;
|
HMQ hmq;
|
||||||
ULONG rc;
|
ULONG rc;
|
||||||
|
|
||||||
// init PM env.
|
// init PM env.
|
||||||
hmq = WinCreateMsgQueue((hab = WinInitialize(0)), 0);
|
hmq = WinCreateMsgQueue((hab = WinInitialize(0)), 0);
|
||||||
|
|
||||||
|
@ -579,7 +579,7 @@ void DeterminePaths()
|
||||||
_path.gm_dir = str_fmt("%sgm\\", _path.game_data_dir);
|
_path.gm_dir = str_fmt("%sgm\\", _path.game_data_dir);
|
||||||
_path.data_dir = str_fmt("%sdata\\", _path.game_data_dir);
|
_path.data_dir = str_fmt("%sdata\\", _path.game_data_dir);
|
||||||
_config_file = str_fmt("%sopenttd.cfg", _path.personal_dir);
|
_config_file = str_fmt("%sopenttd.cfg", _path.personal_dir);
|
||||||
|
|
||||||
#if defined CUSTOM_LANG_DIR
|
#if defined CUSTOM_LANG_DIR
|
||||||
// sets the search path for lng files to the custom one
|
// sets the search path for lng files to the custom one
|
||||||
_path.lang_dir = malloc( MAX_PATH );
|
_path.lang_dir = malloc( MAX_PATH );
|
||||||
|
|
|
@ -68,7 +68,7 @@ static int GetCurRes()
|
||||||
static inline bool RoadVehiclesAreBuilt(void)
|
static inline bool RoadVehiclesAreBuilt(void)
|
||||||
{
|
{
|
||||||
Vehicle *v;
|
Vehicle *v;
|
||||||
FOR_ALL_VEHICLES(v) {
|
FOR_ALL_VEHICLES(v) {
|
||||||
if (v->type == VEH_Road) return true;
|
if (v->type == VEH_Road) return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
|
|
@ -996,7 +996,7 @@ int32 CmdRefitShip(int x, int y, uint32 flags, uint32 p1, uint32 p2)
|
||||||
v->u.ship.state != 0x80)
|
v->u.ship.state != 0x80)
|
||||||
return_cmd_error(STR_980B_SHIP_MUST_BE_STOPPED_IN);
|
return_cmd_error(STR_980B_SHIP_MUST_BE_STOPPED_IN);
|
||||||
}
|
}
|
||||||
|
|
||||||
cost = 0;
|
cost = 0;
|
||||||
if (IS_HUMAN_PLAYER(v->owner) && (byte)p2 != v->cargo_type) {
|
if (IS_HUMAN_PLAYER(v->owner) && (byte)p2 != v->cargo_type) {
|
||||||
cost = _price.ship_base >> 7;
|
cost = _price.ship_base >> 7;
|
||||||
|
@ -1006,7 +1006,7 @@ int32 CmdRefitShip(int x, int y, uint32 flags, uint32 p1, uint32 p2)
|
||||||
//autorefitted ships wants to keep the cargo
|
//autorefitted ships wants to keep the cargo
|
||||||
//it will be checked if the cargo is valid in CmdRenewVehicle
|
//it will be checked if the cargo is valid in CmdRenewVehicle
|
||||||
if (!(SkipStoppedInDepotCheck))
|
if (!(SkipStoppedInDepotCheck))
|
||||||
v->cargo_count = 0;
|
v->cargo_count = 0;
|
||||||
v->cargo_type = (byte)p2;
|
v->cargo_type = (byte)p2;
|
||||||
InvalidateWindow(WC_VEHICLE_DETAILS, v->index);
|
InvalidateWindow(WC_VEHICLE_DETAILS, v->index);
|
||||||
}
|
}
|
||||||
|
|
2
sprite.h
2
sprite.h
|
@ -73,7 +73,7 @@ struct DeterministicSpriteGroup {
|
||||||
} operation;
|
} operation;
|
||||||
byte add_val;
|
byte add_val;
|
||||||
byte divmod_val;
|
byte divmod_val;
|
||||||
|
|
||||||
// And apply it to this:
|
// And apply it to this:
|
||||||
byte num_ranges;
|
byte num_ranges;
|
||||||
struct DeterministicSpriteGroupRange *ranges; // Dynamically allocated
|
struct DeterministicSpriteGroupRange *ranges; // Dynamically allocated
|
||||||
|
|
|
@ -82,9 +82,9 @@ enum {
|
||||||
CA_AIR_SMALL = 4,
|
CA_AIR_SMALL = 4,
|
||||||
CA_AIR_LARGE = 5,
|
CA_AIR_LARGE = 5,
|
||||||
CA_DOCK = 5,
|
CA_DOCK = 5,
|
||||||
CA_AIR_METRO = 6,
|
CA_AIR_METRO = 6,
|
||||||
CA_AIR_INTER = 8,
|
CA_AIR_INTER = 8,
|
||||||
};
|
};
|
||||||
|
|
||||||
void ModifyStationRatingAround(TileIndex tile, byte owner, int amount, uint radius);
|
void ModifyStationRatingAround(TileIndex tile, byte owner, int amount, uint radius);
|
||||||
|
|
||||||
|
|
2
stdafx.h
2
stdafx.h
|
@ -37,7 +37,7 @@
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef __MORPHOS__
|
#ifdef __MORPHOS__
|
||||||
// morphos defines certain amiga defines per default, we undefine them
|
// morphos defines certain amiga defines per default, we undefine them
|
||||||
// here to make the rest of source less messy and more clear what is
|
// here to make the rest of source less messy and more clear what is
|
||||||
// required for morphos and what for amigaos
|
// required for morphos and what for amigaos
|
||||||
# ifdef amigaos
|
# ifdef amigaos
|
||||||
|
|
|
@ -37,14 +37,14 @@ static const char *name_original_english_2[] = {
|
||||||
"W"
|
"W"
|
||||||
};
|
};
|
||||||
|
|
||||||
static const char *name_original_english_3[] = {
|
static const char *name_original_english_3[] = {
|
||||||
"ar",
|
"ar",
|
||||||
"a",
|
"a",
|
||||||
"e",
|
"e",
|
||||||
"in",
|
"in",
|
||||||
"on",
|
"on",
|
||||||
"u",
|
"u",
|
||||||
"un",
|
"un",
|
||||||
"en"
|
"en"
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -107,7 +107,7 @@ static const char *name_additional_english_prefix[] = {
|
||||||
|
|
||||||
static const char *name_additional_english_1a[] = {
|
static const char *name_additional_english_1a[] = {
|
||||||
"Pen",
|
"Pen",
|
||||||
"Lough",
|
"Lough",
|
||||||
"Stam",
|
"Stam",
|
||||||
"Aber",
|
"Aber",
|
||||||
"Acc",
|
"Acc",
|
||||||
|
@ -180,18 +180,18 @@ static const char *name_additional_english_1b1[] = {
|
||||||
"W"
|
"W"
|
||||||
};
|
};
|
||||||
|
|
||||||
static const char *name_additional_english_1b2[] = {
|
static const char *name_additional_english_1b2[] = {
|
||||||
"ar",
|
"ar",
|
||||||
"a",
|
"a",
|
||||||
"e",
|
"e",
|
||||||
"in",
|
"in",
|
||||||
"on",
|
"on",
|
||||||
"u",
|
"u",
|
||||||
"o",
|
"o",
|
||||||
"ee",
|
"ee",
|
||||||
"es",
|
"es",
|
||||||
"ea",
|
"ea",
|
||||||
"un",
|
"un",
|
||||||
"en"
|
"en"
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -603,8 +603,8 @@ static const char *name_german_4_an_der[] = {
|
||||||
"Saale",
|
"Saale",
|
||||||
"Elbe"
|
"Elbe"
|
||||||
};
|
};
|
||||||
|
|
||||||
static const char *name_german_4_am[] = {
|
static const char *name_german_4_am[] = {
|
||||||
"Main"
|
"Main"
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -490,7 +490,7 @@ const DrawTileSeqStruct _station_display_datas_088[] = {
|
||||||
|
|
||||||
// runway tiles
|
// runway tiles
|
||||||
const DrawTileSeqStruct _station_display_datas_089[] = {
|
const DrawTileSeqStruct _station_display_datas_089[] = {
|
||||||
{ 0, 0, 0, 16, 1, 6, 0x8A68 }, // fences
|
{ 0, 0, 0, 16, 1, 6, 0x8A68 }, // fences
|
||||||
TILE_SEQ_END()
|
TILE_SEQ_END()
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -1072,14 +1072,14 @@ int32 CmdRefitRailVehicle(int x, int y, uint32 flags, uint32 p1, uint32 p2)
|
||||||
p2 = p2 & 0xFF;
|
p2 = p2 & 0xFF;
|
||||||
|
|
||||||
SET_EXPENSES_TYPE(EXPENSES_TRAIN_RUN);
|
SET_EXPENSES_TYPE(EXPENSES_TRAIN_RUN);
|
||||||
|
|
||||||
v = &_vehicles[p1];
|
v = &_vehicles[p1];
|
||||||
if (!CheckOwnership(v->owner) || ((CheckStoppedInDepot(v) < 0) && !(SkipStoppedInDepotCheck)))
|
if (!CheckOwnership(v->owner) || ((CheckStoppedInDepot(v) < 0) && !(SkipStoppedInDepotCheck)))
|
||||||
return CMD_ERROR;
|
return CMD_ERROR;
|
||||||
|
|
||||||
cost = 0;
|
cost = 0;
|
||||||
num = 0;
|
num = 0;
|
||||||
|
|
||||||
do {
|
do {
|
||||||
/* XXX: We also refit all the attached wagons en-masse if they
|
/* XXX: We also refit all the attached wagons en-masse if they
|
||||||
* can be refitted. This is how TTDPatch does it. TODO: Have
|
* can be refitted. This is how TTDPatch does it. TODO: Have
|
||||||
|
|
|
@ -81,7 +81,7 @@ static void DoPlaceMoreTrees(uint tile)
|
||||||
|
|
||||||
/* Only on tiles within 13 squares from tile,
|
/* Only on tiles within 13 squares from tile,
|
||||||
on clear tiles, and NOT on farm-tiles or rocks */
|
on clear tiles, and NOT on farm-tiles or rocks */
|
||||||
if (dist <= 13 && IS_TILETYPE(cur_tile, MP_CLEAR) &&
|
if (dist <= 13 && IS_TILETYPE(cur_tile, MP_CLEAR) &&
|
||||||
(_map5[cur_tile] & 0x1F) != 0x0F && (_map5[cur_tile] & 0x1C) != 8) {
|
(_map5[cur_tile] & 0x1F) != 0x0F && (_map5[cur_tile] & 0x1C) != 8) {
|
||||||
PlaceTree(cur_tile, r, dist <= 6 ? 0xC0 : 0);
|
PlaceTree(cur_tile, r, dist <= 6 ? 0xC0 : 0);
|
||||||
}
|
}
|
||||||
|
|
4
unix.c
4
unix.c
|
@ -25,7 +25,7 @@ ULONG __stack = (1024*1024)*2; // maybe not that much is needed actually ;)
|
||||||
|
|
||||||
#ifdef __AMIGA__
|
#ifdef __AMIGA__
|
||||||
#warning add stack symbol to avoid that user needs to set stack manually (tokai)
|
#warning add stack symbol to avoid that user needs to set stack manually (tokai)
|
||||||
// ULONG __stack =
|
// ULONG __stack =
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static char *_fios_path;
|
static char *_fios_path;
|
||||||
|
@ -506,7 +506,7 @@ void DeterminePaths()
|
||||||
_path.data_dir = str_fmt("%sdata/", _path.game_data_dir);
|
_path.data_dir = str_fmt("%sdata/", _path.game_data_dir);
|
||||||
_config_file = str_fmt("%sopenttd.cfg", _path.personal_dir);
|
_config_file = str_fmt("%sopenttd.cfg", _path.personal_dir);
|
||||||
_log_file = str_fmt("%sopenttd.log", _path.personal_dir);
|
_log_file = str_fmt("%sopenttd.log", _path.personal_dir);
|
||||||
|
|
||||||
#if defined CUSTOM_LANG_DIR
|
#if defined CUSTOM_LANG_DIR
|
||||||
// sets the search path for lng files to the custom one
|
// sets the search path for lng files to the custom one
|
||||||
_path.lang_dir = malloc( MAX_PATH );
|
_path.lang_dir = malloc( MAX_PATH );
|
||||||
|
|
26
vehicle.c
26
vehicle.c
|
@ -1409,17 +1409,17 @@ int32 CmdReplaceVehicle(int x, int y, uint32 flags, uint32 p1, uint32 p2)
|
||||||
This is a nice way to send 32 bit and only use 16 bit
|
This is a nice way to send 32 bit and only use 16 bit
|
||||||
the last 8 bit is the engine. The 8 bits in front of the engine is free so it have room for 16 bit engine entries */
|
the last 8 bit is the engine. The 8 bits in front of the engine is free so it have room for 16 bit engine entries */
|
||||||
uint16 new_engine_type = (uint16)(p2 & 0xFFFF);
|
uint16 new_engine_type = (uint16)(p2 & 0xFFFF);
|
||||||
uint32 autorefit_money = (p2 >> 16) * 100000;
|
uint32 autorefit_money = (p2 >> 16) * 100000;
|
||||||
Vehicle *v = DEREF_VEHICLE(p1);
|
Vehicle *v = DEREF_VEHICLE(p1);
|
||||||
int cost, build_cost;
|
int cost, build_cost;
|
||||||
|
|
||||||
SET_EXPENSES_TYPE(EXPENSES_NEW_VEHICLES);
|
SET_EXPENSES_TYPE(EXPENSES_NEW_VEHICLES);
|
||||||
|
|
||||||
|
|
||||||
// first we make sure that it's a valid type the user requested
|
// first we make sure that it's a valid type the user requested
|
||||||
// check that it's an engine that is in the engine array
|
// check that it's an engine that is in the engine array
|
||||||
if (new_engine_type >= TOTAL_NUM_ENGINES ) return CMD_ERROR;
|
if (new_engine_type >= TOTAL_NUM_ENGINES ) return CMD_ERROR;
|
||||||
|
|
||||||
// check that the new vehicle type is the same as the original one
|
// check that the new vehicle type is the same as the original one
|
||||||
if (v->type != DEREF_ENGINE(new_engine_type)->type) return CMD_ERROR;
|
if (v->type != DEREF_ENGINE(new_engine_type)->type) return CMD_ERROR;
|
||||||
|
|
||||||
|
@ -1466,7 +1466,7 @@ int32 CmdReplaceVehicle(int x, int y, uint32 flags, uint32 p1, uint32 p2)
|
||||||
if (flags & DC_EXEC) {
|
if (flags & DC_EXEC) {
|
||||||
Engine *e;
|
Engine *e;
|
||||||
e = DEREF_ENGINE(new_engine_type);
|
e = DEREF_ENGINE(new_engine_type);
|
||||||
|
|
||||||
// TODO make it check if refit is possible before actually doing it
|
// TODO make it check if refit is possible before actually doing it
|
||||||
|
|
||||||
/* We do not really buy a new vehicle, we upgrade the old one */
|
/* We do not really buy a new vehicle, we upgrade the old one */
|
||||||
|
@ -1474,7 +1474,7 @@ int32 CmdReplaceVehicle(int x, int y, uint32 flags, uint32 p1, uint32 p2)
|
||||||
byte cargo_type = v->cargo_type;
|
byte cargo_type = v->cargo_type;
|
||||||
v->engine_type = new_engine_type;
|
v->engine_type = new_engine_type;
|
||||||
v->max_age = e->lifelength * 366;
|
v->max_age = e->lifelength * 366;
|
||||||
|
|
||||||
/* Update limits of the vehicle (for when upgraded) */
|
/* Update limits of the vehicle (for when upgraded) */
|
||||||
switch (v->type) {
|
switch (v->type) {
|
||||||
case VEH_Train:
|
case VEH_Train:
|
||||||
|
@ -1489,7 +1489,7 @@ int32 CmdReplaceVehicle(int x, int y, uint32 flags, uint32 p1, uint32 p2)
|
||||||
v->max_speed = rvi->max_speed;
|
v->max_speed = rvi->max_speed;
|
||||||
|
|
||||||
v->u.rail.railtype = e->railtype;
|
v->u.rail.railtype = e->railtype;
|
||||||
|
|
||||||
// 0x0100 means that we skip the check for being stopped inside the depot
|
// 0x0100 means that we skip the check for being stopped inside the depot
|
||||||
// since we do not stop it for autorefitting
|
// since we do not stop it for autorefitting
|
||||||
if (v->cargo_type != cargo_type && capacity) {
|
if (v->cargo_type != cargo_type && capacity) {
|
||||||
|
@ -1521,7 +1521,7 @@ int32 CmdReplaceVehicle(int x, int y, uint32 flags, uint32 p1, uint32 p2)
|
||||||
v->cargo_type = svi->cargo_type;
|
v->cargo_type = svi->cargo_type;
|
||||||
v->cargo_cap = svi->capacity;
|
v->cargo_cap = svi->capacity;
|
||||||
v->max_speed = svi->max_speed;
|
v->max_speed = svi->max_speed;
|
||||||
|
|
||||||
// 0x0100 means that we skip the check for being stopped inside the depot
|
// 0x0100 means that we skip the check for being stopped inside the depot
|
||||||
// since we do not stop it for autorefitting
|
// since we do not stop it for autorefitting
|
||||||
if (v->cargo_type != cargo_type)
|
if (v->cargo_type != cargo_type)
|
||||||
|
@ -1559,7 +1559,7 @@ int32 CmdReplaceVehicle(int x, int y, uint32 flags, uint32 p1, uint32 p2)
|
||||||
v->cargo_count = v->cargo_cap;
|
v->cargo_count = v->cargo_cap;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
v->reliability = e->reliability;
|
v->reliability = e->reliability;
|
||||||
v->reliability_spd_dec = e->reliability_spd_dec;
|
v->reliability_spd_dec = e->reliability_spd_dec;
|
||||||
v->age = 0;
|
v->age = 0;
|
||||||
|
@ -1580,7 +1580,7 @@ int32 CmdReplaceVehicle(int x, int y, uint32 flags, uint32 p1, uint32 p2)
|
||||||
void MaybeReplaceVehicle(Vehicle *v)
|
void MaybeReplaceVehicle(Vehicle *v)
|
||||||
{
|
{
|
||||||
uint32 new_engine_and_autoreplace_money;
|
uint32 new_engine_and_autoreplace_money;
|
||||||
|
|
||||||
if (v->owner != _local_player)
|
if (v->owner != _local_player)
|
||||||
return;
|
return;
|
||||||
// uncomment next line if you want to see what engine type just entered a depot
|
// uncomment next line if you want to see what engine type just entered a depot
|
||||||
|
@ -1597,7 +1597,7 @@ void MaybeReplaceVehicle(Vehicle *v)
|
||||||
}
|
}
|
||||||
/* Now replace the vehicle */
|
/* Now replace the vehicle */
|
||||||
_current_player = v->owner;
|
_current_player = v->owner;
|
||||||
|
|
||||||
/* makes the variable to inform about how much money the player wants to have left after replacing
|
/* makes the variable to inform about how much money the player wants to have left after replacing
|
||||||
and which engine to replace with
|
and which engine to replace with
|
||||||
the first 16 bit is the money. Since we know the last 5 digits is 0, they are thrown away.
|
the first 16 bit is the money. Since we know the last 5 digits is 0, they are thrown away.
|
||||||
|
@ -1605,9 +1605,9 @@ void MaybeReplaceVehicle(Vehicle *v)
|
||||||
This is a nice way to send 32 bit and only use 16 bit
|
This is a nice way to send 32 bit and only use 16 bit
|
||||||
the last 8 bit is the engine. The 8 bits in front of the engine is free so it have room for 16 bit engine entries */
|
the last 8 bit is the engine. The 8 bits in front of the engine is free so it have room for 16 bit engine entries */
|
||||||
new_engine_and_autoreplace_money = ((_patches.autorenew_money / 100000) << 16) + _autoreplace_array[v->engine_type];
|
new_engine_and_autoreplace_money = ((_patches.autorenew_money / 100000) << 16) + _autoreplace_array[v->engine_type];
|
||||||
|
|
||||||
assert(v->type == DEREF_ENGINE(_autoreplace_array[v->engine_type])->type);
|
assert(v->type == DEREF_ENGINE(_autoreplace_array[v->engine_type])->type);
|
||||||
|
|
||||||
if ( v->type != VEH_Train ) {
|
if ( v->type != VEH_Train ) {
|
||||||
DoCommandP(v->tile, v->index, new_engine_and_autoreplace_money, NULL, CMD_REPLACE_VEHICLE | CMD_SHOW_NO_ERROR);
|
DoCommandP(v->tile, v->index, new_engine_and_autoreplace_money, NULL, CMD_REPLACE_VEHICLE | CMD_SHOW_NO_ERROR);
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -364,7 +364,7 @@ static void SetupScrollStuffForReplaceWindow(Window *w)
|
||||||
|
|
||||||
sel[0] = WP(w,replaceveh_d).sel_index[0];
|
sel[0] = WP(w,replaceveh_d).sel_index[0];
|
||||||
sel[1] = WP(w,replaceveh_d).sel_index[1];
|
sel[1] = WP(w,replaceveh_d).sel_index[1];
|
||||||
|
|
||||||
switch (WP(w,replaceveh_d).vehicletype) {
|
switch (WP(w,replaceveh_d).vehicletype) {
|
||||||
case VEH_Train: {
|
case VEH_Train: {
|
||||||
railtype = WP(w,replaceveh_d).railtype;
|
railtype = WP(w,replaceveh_d).railtype;
|
||||||
|
@ -510,10 +510,10 @@ static void DrawEngineArrayInReplaceWindow(Window *w, int x, int y, int x2, int
|
||||||
|
|
||||||
sel[0] = sel1;
|
sel[0] = sel1;
|
||||||
sel[1] = sel2;
|
sel[1] = sel2;
|
||||||
|
|
||||||
selected_id[0] = selected_id1;
|
selected_id[0] = selected_id1;
|
||||||
selected_id[1] = selected_id2;
|
selected_id[1] = selected_id2;
|
||||||
|
|
||||||
switch (WP(w,replaceveh_d).vehicletype) {
|
switch (WP(w,replaceveh_d).vehicletype) {
|
||||||
case VEH_Train: {
|
case VEH_Train: {
|
||||||
byte railtype = WP(w,replaceveh_d).railtype;
|
byte railtype = WP(w,replaceveh_d).railtype;
|
||||||
|
|
2
widget.c
2
widget.c
|
@ -408,7 +408,7 @@ void DrawWindowWidgets(Window *w)
|
||||||
|
|
||||||
case WWT_RESIZEBOX: {
|
case WWT_RESIZEBOX: {
|
||||||
assert(r.right - r.left == 11); // XXX - to ensure the same sizes are used everywhere!
|
assert(r.right - r.left == 11); // XXX - to ensure the same sizes are used everywhere!
|
||||||
|
|
||||||
DrawFrameRect(r.left, r.top, r.right, r.bottom, wi->color, 0);
|
DrawFrameRect(r.left, r.top, r.right, r.bottom, wi->color, 0);
|
||||||
DrawSprite(SPR_WINDOW_RESIZE, r.left + 3, r.top + 3);
|
DrawSprite(SPR_WINDOW_RESIZE, r.left + 3, r.top + 3);
|
||||||
break;
|
break;
|
||||||
|
|
2
win32.c
2
win32.c
|
@ -1461,7 +1461,7 @@ static void Win32InitializeExceptions()
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
/* Get rid of unused variable warnings.. ShowOSErrorBox
|
/* Get rid of unused variable warnings.. ShowOSErrorBox
|
||||||
* is now used twice, once in MSVC, and once in all other Win
|
* is now used twice, once in MSVC, and once in all other Win
|
||||||
* compilers (cygwin, mingw, etc.) */
|
* compilers (cygwin, mingw, etc.) */
|
||||||
void ShowOSErrorBox(const char *buf)
|
void ShowOSErrorBox(const char *buf)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue