Commit Graph

847 Commits

Author SHA1 Message Date
ZehM4tt 08230f047c Fix desync if "Handyman mow grass by default" is checked. (#5652) 2017-06-18 20:43:15 +02:00
Gymnasiast ed905f3c68 Add define for number of colour schemes, correct several cases of max stations per ride 2017-06-17 14:31:48 +02:00
Michał Janiszewski 9903c15e2a Remove various trailing whitespaces
[ci skip]
2017-06-17 13:41:40 +02:00
ZehM4tt 60bf5083fc Fixed few multiplayer desync issues. (#5578)
This addresses some of the desync causes:

* `vehicle_create_car` was using `scenario_rand` when it shouldn't have
* ghost elements affected grass growth
* ghost elements affecting peep logic[1]

It also adds some desync debug facilities, enabled at compile time.

It also reverts part of change introduced in
https://github.com/OpenRCT2/OpenRCT2/pull/5185,
namely reorder of desync check vs call to `ProcessGameCommandQueue();`

[1] It is not ideal to have this check in multiple locations, it is prone
to human error. We already have `map_remove_provisional_elements`,
but it is possible it does not work as well as it should. This needs
further investigation.
2017-06-12 12:11:01 +02:00
Ted John 945d960cb7 Hide guest money effects on title screen 2017-06-07 23:20:35 +01:00
Michał Janiszewski ff9417f4a6 Validate access to peep_loading_positions (#4475) 2017-06-07 21:56:29 +01:00
Michał Janiszewski 61d38511bc Expand tabs to spaces
This commit expands tabs to spaces (ts=4) in all the files under src/
and test/.

Until now we had two wildly different code styles with C using tabs and
new C++ using spaces. It is painful to maintain as none of the commonly
used tools support this kind of setup and in reality is needless, as we
can simply convert all the sources to spaces and have opened PRs do the
same, where needed.

Additionally, trailing whitespace has been removed.
2017-06-06 23:46:14 +02:00
Michał Janiszewski 37a3179639 Fix #5558: can't hire staff
Caused by invalid flag check
2017-06-06 21:17:57 +02:00
Michael Steenbeek f3b4c88783 Merge pull request #5532 from OpenRCT2/sub_hex_fix
Name sub_<hex>() functions
2017-06-06 16:14:54 +02:00
rwjuk aa81ee4601 Add another RCT2 address comment
[ci skip]
2017-06-06 13:55:23 +01:00
rwjuk f0dec49e6d Add RCT2 address comments
[ci skip]
2017-06-06 13:48:06 +01:00
Michał Janiszewski c49f27dcab Peep pathfinding asserts (#3340) 2017-06-06 08:25:52 +01:00
Ted John c95dbf4b2f Merge pull request #5295 from janisozaur/fix-staff-hiring
Fix staff hiring check
2017-06-06 08:24:41 +01:00
rwjuk aa17f296cb Name sub_693BE5() and second param 2017-06-06 00:51:34 +01:00
rwjuk b346be8488 Name sub_68F8CD() 2017-06-06 00:47:08 +01:00
rwjuk c3401b75d5 Name sub_6B7588() 2017-06-06 00:47:08 +01:00
Richard Jenkins 457a2f624c Name sub_69AF1E() 2017-06-06 00:47:08 +01:00
Richard Jenkins 5abb5c9e9f More accurate name for sub_693BAB() 2017-06-06 00:47:08 +01:00
Richard Jenkins 03286af22b Name sub_693BAB() 2017-06-06 00:47:08 +01:00
Richard Jenkins 322a2432bb Name sub_693C9E() 2017-06-06 00:47:07 +01:00
Richard Jenkins 954124738c Name sub_693B58(), and minor formatting tweak to it 2017-06-06 00:47:07 +01:00
Richard Jenkins 7a3bc1e5fd Rename rct_ride->undercover_portion to sheltered_eighths. 2017-06-06 00:47:07 +01:00
Ted John 16ac68533f Disable for network games
As it would cause desyncs, and we can not easily mitigate this at the moment.
2017-06-05 21:32:28 +01:00
Sam Olsen b9e9b8320f Add enhancement to show money effect when peeps make purchases 2017-06-05 21:02:05 +01:00
Michał Janiszewski 79d76759bb Fix #5516: Update copyrights for 2017
Not all files were necessarily _changed_, but all were touched, see
https://github.com/OpenRCT2/OpenRCT2/pull/4932
2017-06-01 21:55:10 +02:00
Ted John 08ae74293d Remove a few more SDL calls from core library 2017-05-29 22:38:44 +02:00
Ted John 0440c3deea Clean up audio.cpp 2017-05-29 22:38:43 +02:00
Ted John d206d181f2 Move audio code to UI project 2017-05-29 22:38:43 +02:00
Ted John bd9839ff50 Get the game working
Mostly just needed to resolve screen size which is now retrieved via ui context.
2017-05-29 22:38:43 +02:00
Marijn van der Werf eaf93430d5 Remove some string additions 2017-05-28 19:49:32 +02:00
Michael Steenbeek 6bd34c1e55 Clean up sub_69101A, use constants for undefined excitement ratings, fixes #5481 2017-05-16 22:36:48 +02:00
duncanspumpkin 69d8794260 Use snake case for peep fields 2017-05-16 20:12:18 +01:00
Gymnasiast d5f1e22a56 Name RIDE_TYPE_FLAG4 flags 2017-05-16 16:37:23 +02:00
Richard Jenkins 6472c0e6c3 Allow ride names to duplicate existing user strings, fixes #5211 2017-05-12 23:43:48 +02:00
Richard Jenkins d6b32591ae Implement guard function for decrementing guest counts
* Implement guard function for decrementing guest counts

* Implement separate functions for incr/decr of peep count globals

* assert() on attempt to increment guest counts over UINT16_MAX

* Increase network version
2017-05-11 18:31:29 +02:00
CraigCraig 58deb3a54a Grammar, readability, and spelling fixes
[ci skip]
2017-05-11 11:45:59 +02:00
Michael Steenbeek a53b01d5b9 Remove magic numbers and Americanisms 2017-05-08 23:54:38 +02:00
Craig Craig 9dd820e2e7 Spelling fixes 2017-05-08 08:30:50 +02:00
zaxcav 268f6d9ac0 Minor improvements to the path finding debugging (#5443) 2017-05-06 15:51:47 +01:00
zaxcav 36ff7e90af Improve ignoring wide flags on patrol zone edges
This is a minor improvement to #5424.

The zone edge detection is expanded to also check the diagonal neighbouring tiles so that the fix in #5242 also works for tiles on an internal corner of a patrol zone.
2017-05-03 08:41:34 +02:00
Marijn van der Werf 3cf725745d Add compile-time checked constants for widget ids 2017-05-02 09:58:25 +02:00
zaxcav 0debd879da Ignore wide flags on patrol zone edges in path finding heuristic, fixes #5414
Wide path flags in patrol zones can divide the paths with an uncrossable boundary. Ignore wide flags on the patrol zone edges to provide doorways for mechanics through these boundaries without otherwise affecting the path finding heuristic.

Fixes #5414.

Requires new network version.
2017-05-02 08:10:09 +02:00
zaxcav 94eb6994fb Prevent peeps walking up and back down ride queues (#5423)
This bug is caused by inconsistent use of peep->interactionRideIndex. The primary use of this value is to record when a peep has decided to go on the ride at the queue entrance so they remember that decision when entering each queue path tile - without this they would re-decide whether to go on the ride each time they walk into a new ride queue tile.

This is also important for making the peeps walk up and back out of the queue when the ride is closed.

This value is also set when a peep decides not to go on a ride (though the reason why is not clear to me), but is not reset/changed on interaction with other tile types (e.g. shops, no entry signs, etc) causing peeps who bounce back on a ride queue entrance to walk up and down the queue.

Fixes #3499

Requires new network version.
2017-05-01 21:29:38 +02:00
CraigCraig e0b875398b Tons of spelling fixes (#5413)
[ci skip]
2017-04-30 06:39:24 +02:00
duncanspumpkin 9257645cb7 Correctly loop. Add typedef for easter egg functions 2017-04-12 20:44:44 +01:00
duncanspumpkin 509afe74cd Refactor easter egg peep functions. Fix #5357 2017-04-12 20:34:12 +01:00
Richard Jenkins 5b685d5cad Don't apply peep_make_passing_peeps_sick() to peeps in a queue, fixes #1992 2017-03-28 09:24:42 +02:00
duncanspumpkin ffeb1fa527 Initial refactor of entrance 2017-03-13 17:33:46 +00:00
Ted John bcc0bfa485 Rename climate.h to Climate.h 2017-03-11 22:59:33 +00:00
Ted John 8148c86f6b Use balloon for create_balloon 2017-03-11 12:57:45 +00:00
Michał Janiszewski 12f0c2d660 Fix staff hiring check 2017-03-10 15:36:29 +01:00
duncanspumpkin 5bd44a6d3f Fix #5265. Queue TV's now correctly detected.
Due to a mistake when implementing only ghost queue TV's were used for increasing peep happiness
2017-03-07 21:13:45 +00:00
Michał Janiszewski 7341f4aadd Remove trailing whitespace
[ci skip]
2017-03-07 20:38:11 +01:00
wolfreak99 38f264cce8 Allow for more peep spawns in the future 2017-03-02 23:02:54 +01:00
Duncan 1654ba4fe4 Merge pull request #5236 from duncanspumpkin/refactor
Refactor fence to wall
2017-02-28 06:56:06 +00:00
Michał Janiszewski 7f48df20ec Refactor input 2017-02-27 20:20:41 +01:00
duncanspumpkin 810bf301f3 Rename map element fence to wall 2017-02-20 21:10:49 +00:00
duncanspumpkin f54c71b61c Rename functions to wall. Refactor game commands 2017-02-20 21:02:19 +00:00
Ted John fb2c835d52 Include new config header 2017-02-18 15:45:10 +00:00
Michał Janiszewski 7d1f86bb51 Explain edge case behaviour of get_ride_queue_end
[ci skip]
2017-02-17 14:11:03 +01:00
Michał Janiszewski 7e6d826c09 Refactor peep action getter 2017-02-17 09:35:53 +01:00
Michał Janiszewski 32438ef6d0 Check for NULL element in get_ride_queue_end 2017-02-17 09:02:50 +01:00
Michał Janiszewski 8f0711f99d Validate peep action in sub_693B58 2017-02-17 08:42:08 +01:00
Michał Janiszewski 03dd026ba0 Fix invalid bounds check in game_command_set_staff_order 2017-02-17 08:36:34 +01:00
wolfreak99 f85dc8ced0 Code fixups 2017-02-08 21:46:54 -05:00
wolfreak99 b0cc772990 Replace gParkEntranceX/Y/Z/Direction with rct_xyzd16 gParkEntrance 2017-02-08 09:39:04 -05:00
duncanspumpkin fef7445f0c Use flags where known. Refactor large 3d signs slightly 2017-02-04 08:12:44 +00:00
wolfreak99 99c68439b1 define MAX_PEEP_SPAWNS and MAX_PARK_ENTRANCES (#5119) 2017-01-29 22:27:14 +01:00
Gymnasiast d476176d73 Import more fields, name mechanic flags, fix booster behaviour 2017-01-26 23:30:16 +00:00
zaxcav f5ae931406 Replace reuse of test_edge with new variable next_test_edge
Value of test_edge is needed for checking all path tiles placed with
zero clearance at that location.
2017-01-26 22:59:54 +01:00
Michał Janiszewski aeef3a7d5d Remove trailing whitespace 2017-01-26 19:51:31 +00:00
duncanspumpkin 98f483e4bb Fix trailing white space. Fixed space indent 2017-01-26 19:51:31 +00:00
duncanspumpkin d951c500c5 Refactor of peep data and label known addresses
Fixes #4545. Incorrect sprite image for chicken and juice
2017-01-26 19:51:30 +00:00
Ted John 93762bf15f Fix issues 2017-01-24 17:32:17 +00:00
Ted John c699c91348 Pick random entertainer costume 2017-01-24 13:06:23 +00:00
Ted John 2900f38cc3 Allow entertainer costume to be given to game command 2017-01-24 13:06:23 +00:00
Michał Janiszewski ceb77b489d Fix map_get_path_element_at to not consider ghosts 2017-01-24 11:30:39 +01:00
Michał Janiszewski 88113ca952 Fix some ghost consideration in peep AI
This is a continuation of
https://github.com/OpenRCT2/OpenRCT2/pull/5094.

While the previous PR cured some desyncs, the real issue remained –
logic of the game considers ghost elements. This change fixes it, to
some extent.

The problem here is we already remove ghosts when interacting over
network (e.g. `footpath_provisional_remove` in `footpath_place_real`),
but this happens only when such a game command is executed in OpenRCT2.
Whenever SV6 gets imported, path map elements already have had edges
calculated for them, neighbours being ghost or not, and we don't update
it. OpenRCT2/OpenRCT2#5094 is one, naïve, way to solve, the other option
would be to recalculate all the paths whenever we load SV6.
2017-01-24 11:29:58 +01:00
Michael Steenbeek 6016339773 Fix two usages of raw RIDE4 flag usages, rename one, add comment
#5065
2017-01-17 12:00:47 +00:00
Ted John 0da434bb8a Fix tall ride consideration
The consideration of tall rides was probably not working properly as it was doing a straight comparrison of a flags variable.
This instead removes it as it already checks if the ride has ratings anyway. I've also added a status check so that guests do not attempt to walk to a ride far away that isn't open.
2017-01-16 14:30:54 +01:00
Broxzier 60603ae10a Use types from common.h 2017-01-14 12:37:31 +01:00
Michał Janiszewski d88635307f Merge pull request #5062 from janisozaur/cmake-warnings
More warnings for CMake
2017-01-13 19:46:30 +01:00
Ted John baed215984 Add helper: ride_has_ratings
#5066
2017-01-13 18:14:38 +00:00
Ted John cf0c489d40 Name flag: RIDE_TYPE_FLAG_13 2017-01-13 13:08:56 +00:00
Ted John ef2ddbf462 Name flag: RIDE_TYPE_FLAG_20 2017-01-13 12:55:47 +00:00
Michał Janiszewski 33dcb1a506 Rename types to avoid shadowing 2017-01-13 10:57:00 +01:00
Michał Janiszewski ecf77e3609 Remove redundant declarations 2017-01-13 10:02:17 +01:00
Michał Janiszewski cf670deb10 Add -Wshadow to CMakeLists and fix offenders 2017-01-13 10:02:17 +01:00
Ted John b79af110c7 Fix more warnings 2017-01-12 18:02:28 +00:00
Ted John 18597bacb1 Fix more warnings 2017-01-12 17:36:05 +00:00
Ted John bd732b99c7 Fix cast warnings 2017-01-12 12:41:47 +00:00
zaxcav 9772c34cee Update debugging messages to reflect changes in how pathfind_history[].direction is updated. 2017-01-06 12:26:23 +01:00
zaxcav 64a2d105e5 Reword comments with "from from". 2017-01-05 21:43:57 +01:00
zaxcav f98b8e9de9 Restrict peep backtracking further via pathfind_history[i].direction
Dependent on the path layout it is possible for peeps to get stuck in backtracking cycles between two or more path tiles - each such tile is a turn around point because from that tile, the reachable tile on the search boundary that is closest to the peep destination is in the direction the peep came from.

When storing/updating the pathfind_histroy, remove the direction the peep came from (in addition to the chosen direction) from the directions left to try to prevent such backtracking.
2017-01-05 17:45:18 +01:00
Ted John 4fbecc2f60 Replace magic numbers with constant SPRITE_INDEX_NULL 2017-01-05 12:49:42 +00:00
Michael Steenbeek 2b35986746 Add and use constant for number of ride types 2017-01-05 09:19:22 +01:00
Ted John 25bc798ff8 Move contents of src into project sub directory 2017-01-04 17:44:12 +00:00