Commit Graph

382 Commits (305062018918425feaad19330e31e65887320cf2)

Author SHA1 Message Date
Jonathan G Rennison 3050620189 Merge branch 'master' into jgrpp
# Conflicts:
#	src/autoreplace_cmd.cpp
#	src/build_vehicle_gui.cpp
#	src/cargotype.cpp
#	src/economy.cpp
#	src/engine_gui.cpp
#	src/industry_cmd.cpp
#	src/industry_gui.cpp
#	src/linkgraph/linkgraph_gui.h
#	src/linkgraph/refresh.cpp
#	src/linkgraph/refresh.h
#	src/newgrf.cpp
#	src/newgrf_airporttiles.h
#	src/newgrf_roadstop.cpp
#	src/newgrf_station.cpp
#	src/newgrf_station.h
#	src/order_base.h
#	src/order_cmd.cpp
#	src/order_func.h
#	src/order_gui.cpp
#	src/pathfinder/pathfinder_type.h
#	src/saveload/afterload.cpp
#	src/subsidy_base.h
#	src/vehicle_cmd.cpp
#	src/vehicle_gui.cpp
#	src/vehicle_gui_base.h
5 months ago
Peter Nelson 400ae65ff2 Codechange: Redefine some cargo-related values in terms of CargoID instead of CargoType.
Values used as special filter types are now defined as offsets from NUM_CARGO instead of confusingly reusing CARGO_NO_REFIT/CARGO_AUTO_REFIT types.
5 months ago
Peter Nelson 952d111b94 Codechange: Split CT_INVALID into CT_INVALID and INVALID_CARGO.
INVALID_CARGO is a CargoID and should be used for most purposes in game.
CT_INVALID is a CargoType used for defining default properties.
5 months ago
Jonathan G Rennison 97e6f3062e Adding of _t to (u)int types, and WChar to char32_t
See: eaae0bb5e
5 months ago
Jonathan G Rennison 9822fa6584
Fix: Trivial autoreplace of mixed cargo articulated engines (#11253)
Do not fail autoreplace/autorenew of mixed cargo articulated engines
due to an inability to refit to mixed cargoes, when no refit is
required because the target engine already has a suitable set of cargoes.
Notably, this allows autorenew (autoreplace to same engine type)
to succeed.
7 months ago
Jonathan G Rennison 94cffc0aea Fix autorenew ship purchase cost not being applied for multi-cargo ships 9 months ago
Jonathan G Rennison f51d51de40 Fix compiler warning in BuildReplacementMultiPartShip 9 months ago
Jonathan G Rennison 7c28ee0213 Autoreplace: Add support for multi-cargo ships 9 months ago
Jonathan G Rennison da35e7bb35 Autoreplace: Handle trivial replacements of mixed cargo articulated engines 9 months ago
Rubidium eaae0bb5e7 Codechange: automatic adding of _t to (u)int types, and WChar to char32_t
for i in `find src -type f|grep -v 3rdparty/fmt|grep -v 3rdparty/catch2|grep -v 3rdparty/opengl|grep -v stdafx.h`; do sed 's/uint16& /uint16 \&/g;s/int8\([ >*),;[]\)/int8_t\1/g;s/int16\([ >*),;[]\)/int16_t\1/g;s/int32\([ >*),;[]\)/int32_t\1/g;s/int64\([ >*),;[]\)/int64_t\1/g;s/ uint32(/ uint32_t(/g;s/_uint8_t/_uint8/;s/Uint8_t/Uint8/;s/ft_int64_t/ft_int64/g;s/uint64$/uint64_t/;s/WChar/char32_t/g;s/char32_t char32_t/char32_t WChar/' -i $i; done
11 months ago
PeterN 2a2443dd01
Feature: Create group of vehicles from manage vehicle list button. (#10890) 12 months ago
Jonathan G Rennison 6880cf24a0 Fix crash in template replacement failure news if autorenew succeeds 1 year ago
Peter Nelson 76516d7f70 Codechange: Use IsValidCargoID/IsValidCargoType.
IsValidCargoType() is used only for unmapped IDs.
1 year ago
Jonathan G Rennison 2ea1766677 Merge branch 'master' into jgrpp
# Conflicts:
#	.github/workflows/commit-checker.yml
#	src/industry_cmd.cpp
#	src/industry_gui.cpp
#	src/landscape.cpp
#	src/linkgraph/linkgraph_gui.cpp
#	src/order_base.h
#	src/order_cmd.cpp
#	src/order_gui.cpp
#	src/saveload/afterload.cpp
#	src/saveload/league_sl.cpp
#	src/saveload/saveload.h
#	src/script/api/script_object.hpp
#	src/script/squirrel_helper.hpp
#	src/settings_table.cpp
#	src/station_cmd.cpp
#	src/table/settings.h.preamble
#	src/tree_cmd.cpp
#	src/tree_map.h
#	src/vehicle.cpp
#	src/waypoint_cmd.cpp
1 year ago
Tyler Trahan 44848f4edf Add: CommandCost supports an optional second error string 1 year ago
Niels Martin Hansen 2fee8ecdda Add #7525: Allow autoreplace with same model vehicle 1 year ago
rubidium42 6ba55e663e Codechange: do not hide variables with other variables 1 year ago
Jonathan G Rennison a9100e93cb Merge branch 'master' into jgrpp
# Conflicts:
#	src/group_cmd.cpp
#	src/lang/korean.txt
#	src/lang/simplified_chinese.txt
#	src/script/api/script_rail.cpp
#	src/tunnelbridge_cmd.cpp
1 year ago
SamuXarick b2a5ebcfc4
Fix 3c047b1: AIGroup.GetProfitLastYear could get values different than those displayed in GUI (#10227)
* Change: Store "all time" and "since minimum age" last year profits on groups

* Fix: Update last year profit for groups when copying vehicle statistics on autoreplace

* Codechange: Refactor profit last year

* Change: Rename some group related items for clarity

* Change: Reorder the fields in GroupStatistics

That way less memory gets wasted.
1 year ago
Jonathan G Rennison 10e76b2788 Fix #10032: Capacities of articulated vehicles in build window
See also: #9954
1 year ago
Jonathan G Rennison 71b6d7a502 Merge branch 'master' into jgrpp
# Conflicts:
#	src/lang/arabic_egypt.txt
#	src/station_cmd.cpp
#	src/station_cmd.h
#	src/timetable_cmd.cpp
#	src/train_cmd.cpp
2 years ago
Patric Stout 77a85e9b4c
Fix: CmdSetAutoReplace didn't validate group type and engine type match (#9950)
Basically, you could setup an auto-replace in a group for trains
to replace a ship with another ship.

Most of the code is surprisingly okay with this, it is only the
group statistics that doesn't like this.
2 years ago
Patric Stout 9957675a66
Fix: autoreplace command did not validate the vehicle argument properly (#9946)
It first checked if the vehicle was in the depot, which for some types
is only a valid action for the primary vehicle. Afterwards, it checked
if the vehicle was a primary vehicle.
2 years ago
Jonathan G Rennison 92142e5684 Add routing restriction action to make exempt from speed adaptation 2 years ago
Jonathan G Rennison e5a421b65a Merge branch 'master' into jgrpp
# Conflicts:
#	src/economy.cpp
#	src/linkgraph/refresh.cpp
#	src/order_cmd.cpp
#	src/saveload/vehicle_sl.cpp
#	src/station.cpp
#	src/station_base.h
#	src/timetable_cmd.cpp
#	src/timetable_gui.cpp
#	src/vehicle.cpp
#	src/vehicle_base.h
#	src/vehicle_cmd.cpp
2 years ago
Niels Martin Hansen e68bf58989 Codechange: Use anonymous union for vehicle orders/old orders list 2 years ago
Jonathan G Rennison 904ff6757d Add slot support to road vehicles, ships and aircraft 2 years ago
Michael Lutz 41fa16f325 Codechange: Don't use globals for return values from vehicle command procs. 3 years ago
Michael Lutz 57b82e2e99 Codechange: Don't use globals for story/goal/sign/group command proc return values. 3 years ago
Michael Lutz e08b3abe7f Codechange: Un-bitstuff group and autoreplace commands. 3 years ago
Michael Lutz 21675ec7e2 Codechange: Un-bitstuff vehicle/engine commands. 3 years ago
Michael Lutz 211c630cbe Codechange: Un-bitstuff order commands. 3 years ago
Michael Lutz 4f3ea3907e Codechange: Un-bitstuff commands taking a ClientID (i.e. CMD_CLIENT_ID). 3 years ago
Michael Lutz e740c24eb7 Codechange: Template DoCommand to automagically reflect the parameters of the command proc.
When finished, this will allow each command handler to take individually
different parameters, obliviating the need for bit-packing.
3 years ago
Michael Lutz 7048e1522f Codechange: Move flags in CommandProc in front of the command arguments. 3 years ago
Michael Lutz 33ca4f2b99 Codechange: Let the compile generate the master command table out of templated command traits.
This is using a non-intrusive type-traits like templated system, which
allows compile-time validation that the command table and the command
enum match up.
3 years ago
Michael Lutz a38bbefe1b Codechange: Untangle command code, flags and error string for DoCommand*. 3 years ago
Michael Lutz b6933a2ebd Codechange: Move command arguments to the back of the DoCommand function call. 3 years ago
Jonathan G Rennison ffef1c9e44 Merge branch 'master' into jgrpp-beta
# Conflicts:
#	src/saveload/cargopacket_sl.cpp
#	src/saveload/cheat_sl.cpp
#	src/saveload/company_sl.cpp
#	src/saveload/engine_sl.cpp
#	src/saveload/map_sl.cpp
#	src/saveload/order_sl.cpp
#	src/saveload/saveload.cpp
#	src/saveload/saveload.h
#	src/saveload/station_sl.cpp
#	src/saveload/vehicle_sl.cpp
#	src/settings.cpp
#	src/settings_gui.cpp
#	src/settings_internal.h
#	src/stdafx.h
#	src/table/settings/settings.ini
#	src/town_cmd.cpp
#	src/vehicle.cpp
3 years ago
Jonathan G Rennison 8a33e98834
Fix #8169: nullptr dereference when autoreplacing vehicle with no orders (#9387) 3 years ago
Jonathan G Rennison 4577b547ea Fix nullptr dereference when autoreplacing vehicle with no orders
In GetIncompatibleRefitOrderIdForAutoreplace
3 years ago
Patric Stout 28e90769f7 Codechange: use "[[maybe_unused]]" instead of a wide variety of other ways we had
While at it, replace OTTD_ASSERT with WITH_ASSERT, as this
is always set if assert() is valid. No matter if NDEBUG is set
or not.
3 years ago
rubidium42 2e136285e1 Codechange: move from C-string to std::string for DoCommand 3 years ago
frosch c2fce47340 Fix #9256, 12e43c697d2: invalid read after free. (#9258)
This also changes ScriptEventVehicleAutoReplaced when replacing wagons:
The event is now only spawned, if the head engine changes, so only if the VehicleID of the consist changes.
Previously replacing wagons spawned an event with OldVehicleID==NewVehicleID.

(cherry picked from commit 5bd8144853)
3 years ago
frosch 5bd8144853
Fix #9256, 12e43c697d2: invalid read after free. (#9258)
This also changes ScriptEventVehicleAutoReplaced when replacing wagons:
The event is now only spawned, if the head engine changes, so only if the VehicleID of the consist changes.
Previously replacing wagons spawned an event with OldVehicleID==NewVehicleID.
3 years ago
Jonathan G Rennison 253772e9af Merge branch 'master' into jgrpp
# Conflicts:
#	CMakeLists.txt
#	COMPILING.md
#	src/console.cpp
#	src/console_cmds.cpp
#	src/console_internal.h
#	src/rev.cpp.in
3 years ago
peter1138 a05bc04b63 Feature: Per-group wagon removal flag. 3 years ago
Jonathan G Rennison edfa04286b Merge branch 'master' into jgrpp
# Conflicts:
#	.github/workflows/release.yml
#	bin/CMakeLists.txt
#	src/dock_gui.cpp
#	src/lang/brazilian_portuguese.txt
#	src/lang/catalan.txt
#	src/lang/czech.txt
#	src/lang/dutch.txt
#	src/lang/english.txt
#	src/lang/english_US.txt
#	src/lang/estonian.txt
#	src/lang/finnish.txt
#	src/lang/french.txt
#	src/lang/german.txt
#	src/lang/hungarian.txt
#	src/lang/indonesian.txt
#	src/lang/italian.txt
#	src/lang/japanese.txt
#	src/lang/korean.txt
#	src/lang/lithuanian.txt
#	src/lang/luxembourgish.txt
#	src/lang/norwegian_bokmal.txt
#	src/lang/polish.txt
#	src/lang/portuguese.txt
#	src/lang/romanian.txt
#	src/lang/russian.txt
#	src/lang/serbian.txt
#	src/lang/simplified_chinese.txt
#	src/lang/slovak.txt
#	src/lang/spanish.txt
#	src/lang/spanish_MX.txt
#	src/lang/swedish.txt
#	src/lang/tamil.txt
#	src/lang/ukrainian.txt
#	src/lang/vietnamese.txt
#	src/newgrf.cpp
#	src/newgrf_gui.cpp
#	src/object_gui.cpp
#	src/pathfinder/yapf/yapf_costrail.hpp
#	src/pathfinder/yapf/yapf_node_rail.hpp
#	src/rail_cmd.cpp
#	src/roadveh_cmd.cpp
#	src/town_cmd.cpp
#	src/vehicle.cpp
#	src/water_cmd.cpp
3 years ago
Patric Stout fece1c57ca
Codechange: Suppress warnings when asserts are disabled (#8917) 3 years ago
Jonathan G Rennison e059a88533
Fix: Autorenew failure advice due to bad refit being shown to all companies (#8681) 3 years ago