From d5f3be091c2c9bbbeb2e55ecc31822e25146ed52 Mon Sep 17 00:00:00 2001 From: Goober5000 Date: Sat, 2 Mar 2024 15:27:49 -0500 Subject: [PATCH] add weapon preloader `ship-create` has had a preloader for many years, but `weapon-create` and `beam-create` did not. This remedies that. --- code/parse/sexp.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/code/parse/sexp.cpp b/code/parse/sexp.cpp index ca84233c3c0..a9d20dcd55d 100644 --- a/code/parse/sexp.cpp +++ b/code/parse/sexp.cpp @@ -4712,6 +4712,20 @@ int get_sexp() do_preload_for_arguments(preload_turret_change_weapon, n, arg_handler); break; + case OP_WEAPON_CREATE: + // weapon class is argument #2 + n = CDDR(start); + // just as with change-ship-class/ship-create, we can use the turret-change-weapon preloader for weapon-create + do_preload_for_arguments(preload_turret_change_weapon, n, arg_handler); + break; + + case OP_BEAM_FLOATING_FIRE: + // beam weapon class is argument #1 + n = CDR(start); + // see above for weapon-create + do_preload_for_arguments(preload_turret_change_weapon, n, arg_handler); + break; + case OP_CHANGE_BACKGROUND: n = CDR(start); do_preload_for_arguments(stars_preload_background, n, arg_handler);