Kp
59bad96d5f
Add back homing weapons cheat for D2
...
Kreator proposed restoring the Descent 2 cheat that grants homing
capability to all weapons. This commit implements that proposition,
with some changes to the implementation details.
Based-on-patch-by: Chris Taylor <chris@icculus.org>
Requested-by: Chris Taylor <https://github.com/dxx-rebirth/dxx-rebirth/pull/318 >
2017-01-29 21:02:48 +00:00
Kp
879070f814
Fix uninitialized value usage during init_player_stats_new_ship
...
init_player_stats_new_ship used select_primary_weapon and
select_secondary_weapon to assign the player's weapons. However, those
functions read the current weapon and jumped according to its value. A
new ship has no defined value for current weapons, so the jump triggered
an uninitialized value warning from Valgrind.
Add new functions set_primary_weapon, set_secondary_weapon that work
like the previous select_* functions, but always take the path used
for weapons not equal, without checking. This prevents the warnings
from Valgrind, as well as a theoretical risk of initializing the ship
improperly.
2016-12-25 00:33:25 +00:00
Kp
19528a85d0
Fix various check_header_includes=1 failures
2016-12-05 00:26:11 +00:00
Kp
968746c0e8
Pass secondary_weapon_index_t to player_has_secondary_weapon
2016-10-02 00:34:49 +00:00
Kp
603159ec4b
Pass secondary_weapon_index_t to do_secondary_weapon_select
2016-10-02 00:34:49 +00:00
Kp
3f27b6daac
Pass player_info to CyclePrimary
2016-10-02 00:34:46 +00:00
Kp
2c37514235
Pass player_info to CycleSecondary
2016-10-02 00:34:46 +00:00
Kp
36213d9b50
Pass player_info to select_secondary_weapon
2016-10-02 00:34:46 +00:00
Kp
e3c3e39045
Pass player_info to do_primary_weapon_select
2016-10-02 00:34:46 +00:00
Kp
8219df8db9
Pass player_info to pick_up_secondary
2016-10-02 00:34:45 +00:00
Kp
c94cec40d0
Pass player_info to pick_up_primary
2016-10-02 00:34:45 +00:00
Kp
2bd5b80451
Pass player_info to check_to_use_primary_super_laser
2016-10-02 00:34:45 +00:00
Kp
86a4942883
Pass player_info to do_secondary_weapon_select
2016-10-02 00:34:45 +00:00
Kp
9800f856e7
Pass player_info to select_primary_weapon
2016-10-02 00:34:45 +00:00
Kp
11551abe5c
Pass player_info to non-static pick_up_vulcan_ammo
2016-10-02 00:34:44 +00:00
Kp
96651095e3
Pass player_info to DropCurrentWeapon, DropSecondaryWeapon
2016-10-02 00:34:44 +00:00
Kp
b78474edc6
Pass player_info to player_has_secondary_weapon
2016-10-02 00:34:44 +00:00
Kp
83dd51d79b
Pass player_info to player_has_primary_weapon
2016-10-02 00:34:43 +00:00
Kp
ab89513454
Pass player_info to auto_select_primary_weapon
2016-10-02 00:34:43 +00:00
Kp
1be7344d56
Pass player_info to auto_select_secondary_weapon
2016-10-02 00:34:43 +00:00
Kp
a88153c7d9
Add prohibit_void_ptr to player_selected_weapon
2016-10-02 00:34:38 +00:00
Kp
335f24ac31
Move Primary_weapon to player_info
2016-08-28 22:41:49 +00:00
Kp
10ff2b9ea2
Change Primary_weapon_to_weapon_info key to weapon_id_type
...
Fix incorrect ID in D1 Primary_weapon_to_weapon_info. Testing suggests
that both the correct and incorrect ID produce the same results.
2016-08-28 22:41:48 +00:00
Kp
b7a5f65d5b
Move Secondary_weapon to player_info
2016-08-28 22:41:48 +00:00
Kp
e7b881e5e6
Move Secondary_last_was_super into player_info
2016-08-28 22:41:48 +00:00
Kp
adf5e57b47
Move Primary_last_was_super into player_info
2016-08-28 22:41:47 +00:00
Kp
ee1003f29f
Move conditionally compiled code into namespace dsx
2016-08-25 04:05:32 +00:00
Kp
1774676571
Use class to wrap Primary_weapon+Delayed_primary
2016-08-06 19:55:23 +00:00
Kp
99bbd0cf26
Mark global constants as constexpr
...
s/^const \([^*]*=.*;\)/constexpr \1/
2016-07-23 04:10:42 +00:00
Kp
27cef20eb3
Move namespace dsx handling to dsx-ns.h
2016-03-19 19:08:10 +00:00
Kp
c3003fbb22
Fix vulcan ammo display
...
Do not abuse `f2i` to shift an unsigned quantity. `f2i` is defined to
work on `fix`, which is `int`.
2016-02-20 17:28:11 +00:00
Kp
dd877f52c2
Remove unused weapon defines
2016-01-09 16:38:15 +00:00
Kp
8e86a3586d
Use #ifdef dsx to guard dsx namespace
2016-01-09 16:38:15 +00:00
Kp
86709f547b
Fix capitalization of PHYSFS_File
...
Per comment in physfs.h, the spelling PHYSFS_file is deprecated.
Replace all instances with PHYSFS_File.
2016-01-09 16:38:14 +00:00
Kp
287a74f88b
Multiplex do_laser_firing_player flags
2015-12-22 04:18:52 +00:00
Kp
db9fb0ed42
Move more symbols into namespace dcx/dsx
2015-12-22 04:18:50 +00:00
Kp
edfd337c50
Compile out unused weapon_info_write
...
Unused since 547193c591
("Compile out unused bm_write_all") disabled caller bm_write_all.
2015-12-04 03:36:31 +00:00
Kp
b683b4cc68
Scope weapon type
2015-12-03 03:26:49 +00:00
Kp
bb41075adb
Add preprocessor guards around types that vary by game
2015-11-26 02:56:55 +00:00
Kp
533f1cb3bb
Qualify references to primary weapons
2015-10-18 21:01:18 +00:00
Kp
2196008178
Move fwdobject.h -> fwd-object.h for consistency
2015-10-10 03:44:14 +00:00
Kp
36c52f7437
Reduce pointer->int->pointer conversions for thief
2015-10-10 03:44:14 +00:00
Kp
9df40a86cb
Use uint8 for secondary ammo counts
...
Maximum non-cheating is 40 missiles, which fits in a signed 8 bit value.
Maximum cheating is 200 missiles, which fits in an unsigned 8 bit value.
2015-10-03 17:17:49 +00:00
Kp
b626ca67e7
Combine game-specific preprocessor blocks
...
Change:
#ifdef D1
x;
#endif
...
#ifdef D1
y;
#endif
to:
#ifdef D1
x;
y;
#endif
...
2015-09-19 23:04:35 +00:00
Kp
946048c54b
Move valptridx subtypes to individual fwd headers
2015-08-22 20:43:04 +00:00
Kp
70c4cc87ab
Use forward-declaration header for weapon.h
2015-07-25 23:10:45 +00:00