Commit Graph

324 Commits

Author SHA1 Message Date
zaxcav a562fc4e0b Remove commented out code. 2016-08-15 12:44:20 +02:00
zaxcav de00f27195 Fix issues with sync adjacent stations
Change try_add_synchronised_station() so that adjacent stations are always in the _synchronisedVehicles list; those without a vehicle to sync have vehicle_id == SPRITE_INDEX_NULL.

Change vehicle_can_depart_synchronised() so that adjacent stations are searched for on both sides of the tile; reverse the logic of the return values to make sense with respect to the function name (all except for the case when there are no adjacent stations, which already made sense and was consequently flipped in relation to all other returns; numerous minor fixes to the checks on the departure conditions/exceptions.

In vehicle_update_waiting_to_depart() flip the logic on the call to vehicle_can_depart_synchronised() according with the above change to its return values.

Fixes issues: #4178 and #4182
2016-08-15 12:13:46 +02:00
Yaroslav Tretyakov 4066009778 Fix #4253: Crash in vehicle_update_motion_collision_detection 2016-08-09 08:35:16 +01:00
Marijn van der Werf d5b8fe3732 Integrate dodgems data 2016-08-07 14:31:13 +02:00
Michał Janiszewski 0ece63a7f6 Wrap RCT2's addresses in RCT2_ADDRESS macro 2016-08-06 21:38:46 +01:00
Marijn van der Werf 3d8b71ffbc Rename `gTrackDefinitions` to `TrackDefinitions` 2016-08-04 01:15:23 +02:00
Michał Janiszewski a7f31dda4f Fix issues from gRideProperties review
Also renames it to RideProperties
2016-08-02 23:04:18 +02:00
Michał Janiszewski 6ba62ed123 Integrate vehicle synchronisation info 2016-08-01 23:33:55 +02:00
Michał Janiszewski 2db2ef5eec Fix pointer types 2016-08-01 23:14:42 +02:00
Michał Janiszewski 09a20524a5 Integrate gRideProperties 2016-08-01 23:14:42 +02:00
Michał Janiszewski 3fcc7ab4ef Fix #3822: Crash in check_and_apply_block_section_stop_site 2016-07-27 23:09:17 +01:00
Ted John f5f4238c0b Merge pull request #3888 from marijnvdwerf/integrate/mini-golf
Integrate mini golf data.
2016-07-26 19:24:08 +01:00
Michał Janiszewski 418eb06e66 Fix #3987: division by zero in vehicle update
Prevent division by zero by checking the value first.
2016-07-23 21:52:28 +01:00
duncanspumpkin 9652f68024 Implemented junior rollercoaster paint 2016-07-22 19:16:03 +01:00
Michał Janiszewski 313230a9a4 Refactor more code to correctly handle sprite count 2016-07-17 23:24:16 +02:00
Michał Janiszewski 381545aa2b Refactor loop in vehicle update not to access invalid memory 2016-07-17 23:14:27 +02:00
Michał Janiszewski 9f57c82653 Refactor access to g_sprite_list
Hide g_sprite_list behind accessor function with a check. `assert` is
temporarily disabled, as it breaks nearly every park.
2016-07-17 22:19:34 +02:00
Michał Janiszewski a2ce5d5696 Integrate gCurrentVehicle 2016-07-16 14:47:53 +01:00
Michał Janiszewski 601f344b40 Integrate g_music_tracking_viewport 2016-07-16 13:07:01 +01:00
Ted John fd339d29b1 import pointer parts of data for top spin and rotations 2016-07-16 13:06:05 +01:00
Ted John 439220b86e import SwingingTimeToSpriteMaps data 2016-07-16 13:06:05 +01:00
Ted John 1d8f14715c import vehicle data for various rides 2016-07-16 13:06:05 +01:00
Duncan 1e1546d87c Merge pull request #4064 from gDanix/fix-4060
Fix #4060: Block brakes have a different behaviour from RCT2.
2016-07-16 13:04:53 +01:00
Michał Janiszewski 1742ce71ed Fix handling of signed types 2016-07-15 18:48:22 +01:00
Michał Janiszewski a6d0e6916e Fix function definitions to match their declarations
This makes sure every function is properly declared, which includes
proper `extern` wrappers.
2016-07-14 14:11:49 +02:00
Marijn van der Werf 5204fb0ce9 Clean up string and sprite ID's (#3977) 2016-07-14 14:07:49 +02:00
Daniel Trujillo 8638cf924d Refactor hill stop site code 2016-07-12 20:33:19 +02:00
Daniel Trujillo 4fba02567f Add support for cable lift chain to stop train (old behaviour) 2016-07-12 19:47:03 +02:00
Daniel Trujillo 37c4b549d2 Revert block brakes behaviour to the old one (always braking)
Anyway, there is possible to swith between different behaviours
through a preprocessor directive
2016-07-12 19:32:53 +02:00
Daniel Trujillo ac314a4d61 Fix the block-sectioned lift chain not working properly 2016-07-12 19:32:53 +02:00
Daniel Trujillo 8eeb6056a1 Fix grammar issues. 2016-07-10 00:01:55 +02:00
Daniel Trujillo 13f6959ae3 Rector block_brake_closed parameter from apply_block_brakes
To remark that is a variable, rather than a constant (closed)
2016-07-09 23:43:04 +02:00
Daniel Trujillo 3e782d9295 Deep splitting and rewriting of the sub_6D... code 2016-07-09 23:43:04 +02:00
Daniel Trujillo a3661e5842 Swapped if/else at line 5402
Applied De Morgan's laws to simplify condition
2016-07-09 23:43:04 +02:00
Daniel Trujillo 453b33a7b7 Move "apply_block_section_stop_site" on top of "check_and_apply...()"
To make it callable from "check_and_apply...()"
2016-07-09 23:43:04 +02:00
Daniel Trujillo 3e0754f14d Rename sub_6DAB4C_chunk_2 2016-07-09 23:43:04 +02:00
Daniel Trujillo 013266c6ae Add needed calls to the new function 2016-07-09 23:43:04 +02:00
Daniel Trujillo ed73a9dfe0 Break vehicle-handling code into another function 2016-07-09 23:43:04 +02:00
Daniel Trujillo efb720326d Add an implicit "else"
After "vehicle->velocity = 0", the sentence:
"vehicle->velocity -= vehicle->velocity >> 3" doesn't have any
effect, so insert an "else" can clarify the code
2016-07-09 23:43:04 +02:00
Daniel Trujillo 95e727d376 Add comments to the code 2016-07-09 23:43:04 +02:00
Daniel Trujillo 92b5e661fb Break an "else" into pieces 2016-07-09 23:43:04 +02:00
Daniel Trujillo f56f7065ac Make more obvious the last "else" previously made with a "return" 2016-07-09 23:43:04 +02:00
Daniel Trujillo cb4fe669a9 Name constant (1 << 5) -> MAP_ELEMENT_FLAG_BLOCK_BREAK_CLOSED 2016-07-09 23:43:04 +02:00
Sijmen Schoon d06633331a Fix the closing of ferris wheels
Well, that was anticlimactic
2016-07-08 23:36:59 +02:00
Daniel Trujillo d731a015ea Fix bug causing block brakes blocking vehicles in non-block mode
A comparison has been added to ensure that, if the ride isn't in a
block-sectioned mode, the block brakes will act as a simple brakes
(with 6 km/h boosters)
2016-07-08 19:03:22 +02:00
Michał Janiszewski 644a36a310 Fixes to -Wall compilation
By default, not all warnings are enabled. This change makes sure that
the project compiles correctly with following options turned on:

    -Wall -Wno-unused-but-set-variable -Wno-missing-braces \
    -Wno-unknown-pragmas -Wno-unused-function
2016-06-20 13:46:27 +01:00
Marijn van der Werf 6050b1d07a Identify `rct_vehicle:var_D4` 2016-06-19 16:17:23 +02:00
Marijn van der Werf 1534c95f9c use integrated data for `vehicle_update` 2016-06-18 00:24:53 +02:00
Michał Janiszewski 542828b5d4 Fix wrong vehicle position, nullptr guard 2016-06-16 23:14:38 +02:00
Michał Janiszewski c2bf4b75e7 Integrate tile map element pointers usage (#3442) 2016-06-16 19:05:15 +02:00