fix path placement for network

This commit is contained in:
zsilencer 2015-07-26 20:15:02 -06:00
parent 584b34e6d5
commit 3a26f56000
6 changed files with 20 additions and 20 deletions

View File

@ -986,7 +986,7 @@ static const uint16 _defaultShortcutKeys[SHORTCUT_COUNT] = {
SDL_SCANCODE_EQUALS, // SHORTCUT_INCREASE_GAME_SPEED,
CTRL | ALT | SDL_SCANCODE_C, // SHORTCUT_OPEN_CHEAT_WINDOW,
SDL_SCANCODE_T, // SHORTCUT_REMOVE_TOP_BOTTOM_TOOLBAR_TOGGLE,
SDL_SCANCODE_C // SHORTCUT_OPEN_CHAT_WINDOW
SDL_SCANCODE_C, // SHORTCUT_OPEN_CHAT_WINDOW
SDL_SCANCODE_UP, // SHORTCUT_SCROLL_MAP_UP
SDL_SCANCODE_LEFT, // SHORTCUT_SCROLL_MAP_LEFT
SDL_SCANCODE_DOWN, // SHORTCUT_SCROLL_MAP_DOWN

View File

@ -534,7 +534,7 @@ int game_do_command_p(int command, int *eax, int *ebx, int *ecx, int *edx, int *
RCT2_GLOBAL(0x009A8C28, uint8)--;
// Show error window
if (RCT2_GLOBAL(0x009A8C28, uint8) == 0 && (flags & GAME_COMMAND_FLAG_APPLY) && RCT2_GLOBAL(0x0141F568, uint8) == RCT2_GLOBAL(0x013CA740, uint8) && !(flags & GAME_COMMAND_FLAG_3))
if (RCT2_GLOBAL(0x009A8C28, uint8) == 0 && (flags & GAME_COMMAND_FLAG_APPLY) && RCT2_GLOBAL(0x0141F568, uint8) == RCT2_GLOBAL(0x013CA740, uint8) && !(flags & GAME_COMMAND_FLAG_ALLOW_DURING_PAUSED))
window_error_open(RCT2_GLOBAL(RCT2_ADDRESS_GAME_COMMAND_ERROR_TITLE, uint16), RCT2_GLOBAL(RCT2_ADDRESS_GAME_COMMAND_ERROR_TEXT, uint16));
return MONEY32_UNDEFINED;

View File

@ -89,7 +89,8 @@ enum GAME_COMMAND {
enum {
GAME_COMMAND_FLAG_APPLY = (1 << 0), // If this flag is set, the command is applied, otherwise only the cost is retrieved
GAME_COMMAND_FLAG_2 = (1 << 2),
GAME_COMMAND_FLAG_3 = (1 << 3),
GAME_COMMAND_FLAG_ALLOW_DURING_PAUSED = (1 << 3), // Allow while paused
GAME_COMMAND_FLAG_4 = (1 << 4),
GAME_COMMAND_FLAG_5 = (1 << 5),
GAME_COMMAND_FLAG_GHOST = (1 << 6),
GAME_COMMAND_FLAG_NETWORKED = (1 << 31) // Game command is coming from network

View File

@ -540,7 +540,7 @@ static const shortcut_action shortcut_table[SHORTCUT_COUNT] = {
shortcut_increase_game_speed,
shortcut_open_cheat_window,
shortcut_remove_top_bottom_toolbar_toggle,
shortcut_open_chat_window
shortcut_open_chat_window,
NULL,
NULL,
NULL,

View File

@ -1963,7 +1963,7 @@ int sub_6D2189(int* cost, uint8* ride_id){
entry_index = 0xFF;
int eax = 0, ebx, ecx = 0, edx, esi, edi = 0, ebp = 0;
ebx = GAME_COMMAND_FLAG_APPLY | GAME_COMMAND_FLAG_3 | GAME_COMMAND_FLAG_5;
ebx = GAME_COMMAND_FLAG_APPLY | GAME_COMMAND_FLAG_ALLOW_DURING_PAUSED | GAME_COMMAND_FLAG_5;
edx = track_design->type | (entry_index << 8);
esi = GAME_COMMAND_CREATE_RIDE;
@ -3185,7 +3185,7 @@ void game_command_place_track_design(int* eax, int* ebx, int* ecx, int* edx, int
RCT2_GLOBAL(0x009DEA60, sint16) = y + 16;
RCT2_GLOBAL(0x009DEA62, sint16) = z;
if (!(flags & GAME_COMMAND_FLAG_3)){
if (!(flags & GAME_COMMAND_FLAG_ALLOW_DURING_PAUSED)){
if (RCT2_GLOBAL(RCT2_ADDRESS_GAME_PAUSED, uint8) != 0 && !gConfigCheat.build_in_pause_mode){
RCT2_GLOBAL(0x00141E9AC, rct_string_id) = STR_CONSTRUCTION_NOT_POSSIBLE_WHILE_GAME_IS_PAUSED;
*ebx = MONEY32_UNDEFINED;
@ -3506,7 +3506,7 @@ static money32 track_place(int rideIndex, int type, int originX, int originY, in
if (!sub_68B044()) {
return MONEY32_UNDEFINED;
}
if (!(flags & GAME_COMMAND_FLAG_3)) {
if (!(flags & GAME_COMMAND_FLAG_ALLOW_DURING_PAUSED)) {
if (RCT2_GLOBAL(RCT2_ADDRESS_GAME_PAUSED, uint8) != 0 && !gConfigCheat.build_in_pause_mode) {
RCT2_GLOBAL(RCT2_ADDRESS_GAME_COMMAND_ERROR_TEXT, rct_string_id) = STR_CONSTRUCTION_NOT_POSSIBLE_WHILE_GAME_IS_PAUSED;
return MONEY32_UNDEFINED;
@ -3649,7 +3649,7 @@ static money32 track_place(int rideIndex, int type, int originX, int originY, in
// push baseZ and clearanceZ
int cur_z = baseZ * 8;
if ((flags & GAME_COMMAND_FLAG_APPLY) && !(flags & GAME_COMMAND_FLAG_3)) {
if ((flags & GAME_COMMAND_FLAG_APPLY) && !(flags & GAME_COMMAND_FLAG_ALLOW_DURING_PAUSED)) {
footpath_remove_litter(x, y, z);
// push bl bh??
if (rideTypeFlags & RIDE_TYPE_FLAG_18) {

View File

@ -34,10 +34,6 @@ void footpath_interrupt_peeps(int x, int y, int z);
void sub_6A7642(int x, int y, rct_map_element *mapElement);
void sub_6A76E9(int rideIndex);
enum {
FOOTPATH_CONSTRUCTION_FLAG_ALLOW_DURING_PAUSED = 1 << 3
};
const rct_xy16 word_981D6C[4] = {
{ -1, 0 },
{ 0, 1 },
@ -148,7 +144,7 @@ static money32 footpath_element_insert(int type, int x, int y, int z, int slope,
if (!sub_68B044())
return MONEY32_UNDEFINED;
if ((flags & GAME_COMMAND_FLAG_APPLY) && !(flags & (FOOTPATH_CONSTRUCTION_FLAG_ALLOW_DURING_PAUSED | (1 << 6))))
if ((flags & GAME_COMMAND_FLAG_APPLY) && !(flags & (GAME_COMMAND_FLAG_ALLOW_DURING_PAUSED | GAME_COMMAND_FLAG_GHOST)))
footpath_remove_litter(x, y, RCT2_GLOBAL(0x009DEA62, uint16));
// loc_6A649D:
@ -320,7 +316,7 @@ static money32 footpath_place_real(int type, int x, int y, int z, int slope, int
RCT2_GLOBAL(0x009DEA60, uint16) = y + 16;
RCT2_GLOBAL(0x009DEA62, uint16) = z * 8;
if (!(flags & FOOTPATH_CONSTRUCTION_FLAG_ALLOW_DURING_PAUSED) && RCT2_GLOBAL(RCT2_ADDRESS_GAME_PAUSED, uint8) != 0 && !gConfigCheat.build_in_pause_mode) {
if (!(flags & GAME_COMMAND_FLAG_ALLOW_DURING_PAUSED) && RCT2_GLOBAL(RCT2_ADDRESS_GAME_PAUSED, uint8) != 0 && !gConfigCheat.build_in_pause_mode) {
RCT2_GLOBAL(RCT2_ADDRESS_GAME_COMMAND_ERROR_TEXT, rct_string_id) = STR_CONSTRUCTION_NOT_POSSIBLE_WHILE_GAME_IS_PAUSED;
return MONEY32_UNDEFINED;
}
@ -355,10 +351,13 @@ static money32 footpath_place_real(int type, int x, int y, int z, int slope, int
return MONEY32_UNDEFINED;
}
footpath_provisional_remove();
mapElement = map_get_footpath_element_slope((x / 32), (y / 32), z, slope);
return mapElement == NULL ?
footpath_element_insert(type, x, y, z, slope, flags) :
footpath_element_update(x, y, mapElement, type, flags);
if (mapElement == NULL) {
return footpath_element_insert(type, x, y, z, slope, flags);
} else {
return footpath_element_update(x, y, mapElement, type, flags);
}
}
/* rct2: 0x006BA23E */
@ -381,7 +380,7 @@ money32 footpath_remove_real(int x, int y, int z, int flags)
RCT2_GLOBAL(0x009DEA60, uint16) = y + 16;
RCT2_GLOBAL(0x009DEA62, uint16) = z * 8;
if (!(flags & FOOTPATH_CONSTRUCTION_FLAG_ALLOW_DURING_PAUSED) && RCT2_GLOBAL(RCT2_ADDRESS_GAME_PAUSED, uint8) != 0 && !gConfigCheat.build_in_pause_mode) {
if (!(flags & GAME_COMMAND_FLAG_ALLOW_DURING_PAUSED) && RCT2_GLOBAL(RCT2_ADDRESS_GAME_PAUSED, uint8) != 0 && !gConfigCheat.build_in_pause_mode) {
RCT2_GLOBAL(RCT2_ADDRESS_GAME_COMMAND_ERROR_TEXT, rct_string_id) = STR_CONSTRUCTION_NOT_POSSIBLE_WHILE_GAME_IS_PAUSED;
return MONEY32_UNDEFINED;
}
@ -453,7 +452,7 @@ money32 footpath_provisional_set(int type, int x, int y, int z, int slope)
footpath_provisional_remove();
cost = footpath_place(type, x, y, z, slope, (1 << 6) | (1 << 5) | (1 << 4) | FOOTPATH_CONSTRUCTION_FLAG_ALLOW_DURING_PAUSED | GAME_COMMAND_FLAG_APPLY);
cost = footpath_place(type, x, y, z, slope, GAME_COMMAND_FLAG_GHOST | GAME_COMMAND_FLAG_5 | GAME_COMMAND_FLAG_4 | GAME_COMMAND_FLAG_ALLOW_DURING_PAUSED | GAME_COMMAND_FLAG_APPLY);
if (cost != MONEY32_UNDEFINED) {
RCT2_GLOBAL(RCT2_ADDRESS_PROVISIONAL_PATH_X, uint16) = x;
RCT2_GLOBAL(RCT2_ADDRESS_PROVISIONAL_PATH_Y, uint16) = y;
@ -479,7 +478,7 @@ void footpath_provisional_remove()
RCT2_GLOBAL(RCT2_ADDRESS_PROVISIONAL_PATH_X, uint16),
RCT2_GLOBAL(RCT2_ADDRESS_PROVISIONAL_PATH_Y, uint16),
RCT2_GLOBAL(RCT2_ADDRESS_PROVISIONAL_PATH_Z, uint16),
(1 << 0) | FOOTPATH_CONSTRUCTION_FLAG_ALLOW_DURING_PAUSED | (1 << 5)
GAME_COMMAND_FLAG_APPLY | GAME_COMMAND_FLAG_ALLOW_DURING_PAUSED | GAME_COMMAND_FLAG_5
);
}
}