diff --git a/decompiler/config/jak2/ntsc_v1/type_casts.jsonc b/decompiler/config/jak2/ntsc_v1/type_casts.jsonc index f8ae7dbc1d..7df2f41b73 100644 --- a/decompiler/config/jak2/ntsc_v1/type_casts.jsonc +++ b/decompiler/config/jak2/ntsc_v1/type_casts.jsonc @@ -1,7 +1,4 @@ { - // auto find-parent-method possible - "(method 3 entity-actor)": [[7, "t9", "(function entity entity)"]], - "(method 3 entity)": [[7, "t9", "(function entity entity)"]], // "(method 2 array)": [ [23, "gp", "(array int32)"], @@ -1780,7 +1777,6 @@ "target-real-post": [[97, "f28", "float"]], "target-compute-pole": [[[12, 180], "s2", "swingpole"]], "tobot-start": [[26, "s5", "target"]], - "(method 10 target)": [[28, "t9", "(function target none)"]], "target-compute-edge": [[48, "a0", "process-drawable"]], "target-compute-edge-rider": [[48, "a0", "process-drawable"]], "target-update-ik": [[288, "f30", "float"]], @@ -1959,19 +1955,9 @@ [468, "a0", "editable-light"] ], "(method 29 editable)": [[[4, 8], "a0", "editable"]], - "(method 28 editable-point)": [ - [88, "t9", "(function editable-point editable-command none)"] - ], "(method 27 editable-plane)": [ - [9, "t9", "(function editable-plane editable-array editable)"], [10, "v0", "editable-plane"] ], - "(method 25 editable-face)": [ - [25, "t9", "(function editable-face editable-array none)"] - ], - "(method 25 editable-plane)": [ - [25, "t9", "(function editable-plane editable-array none)"] - ], "(method 29 editable-face)": [ [234, "a1", "editable-point"], [241, "f0", "float"], @@ -1984,12 +1970,8 @@ [387, "a1", "(array editable-point)"] ], "(method 27 editable-face)": [ - [9, "t9", "(function editable-face editable-array editable)"], [10, "v0", "editable-face"] ], - "(method 25 editable-light)": [ - [9, "t9", "(function editable-light editable-array none)"] - ], "(method 25 editable)": [[[12, 17], "a0", "editable"]], "merc-edge-stats": [[31, "v1", "merc-ctrl"]], "(method 8 merc-ctrl)": [ @@ -2179,7 +2161,6 @@ ], "(method 12 minimap)": [[18, "v0", "connection-minimap"]], "update-task-masks": [[30, "s5", "connection-minimap"]], - "(method 10 fail-mission)": [[43, "t9", "(function process process)"]], "restart-mission": [ [8, "v1", "connection"], [5, "v1", "connection"], @@ -2700,7 +2681,6 @@ ], "set-fog-height!": [[2, "v1", "(array texture-anim)"]], "unpack-comp-huf": [[[21, 23], "t3", "(pointer uint16)"]], - "(method 10 elec-gate)": [[13, "t9", "(function process-drawable none)"]], "(method 11 elec-gate)": [ [180, "a0", "vector"], [193, "a0", "vector"] @@ -2723,9 +2703,6 @@ [53, "gp", "process-focusable"] ], "(event idle bouncer)": [[[120, 127], "v1", "attack-info"]], - "(method 7 conveyor)": [ - [12, "t9", "(function process-drawable int process-drawable)"] - ], "(method 27 conveyor)": [ [23, "a0", "connection"], [24, "a0", "collide-shape"], @@ -2742,7 +2719,6 @@ ], "(code idle lgconveyor)": [[10, "v1", "art-joint-anim"]], "(post idle lgconveyor)": [[4, "t9", "(function none)"]], - "(method 7 elevator)": [[14, "t9", "(function base-plat int base-plat)"]], "elevator-event": [ [23, "v1", "focus"], [88, "gp", "float"], @@ -2909,7 +2885,6 @@ [[147, 217], "v1", "mc-status-code"] ], "memcard-unlocked-secrets?": [[50, "s5", "int"]], - "(method 10 progress)": [[45, "t9", "(function progress none)"]], "load-game-text-info": [[4, "v1", "game-text-info"]], "(method 16 camera-master)": [ [[11, 15], "a2", "target"], @@ -3208,14 +3183,10 @@ "(code target-look-around)": [[21, "v0", "float"]], "(exit target-swim-stance)": [[51, "v0", "sound-rpc-set-param"]], "(exit target-swim-down)": [[56, "v0", "sound-rpc-set-param"]], - "(method 7 water-anim)": [[14, "t9", "(function water-anim int water-anim)"]], "(method 26 water-anim)": [ ["_stack_", 16, "res-tag"], [52, "v0", "(pointer float)"] ], - "(method 7 flow-control)": [ - [19, "t9", "(function flow-control int flow-control)"] - ], "water-anim-event-handler": [ [23, "v1", "float"], [40, "s4", "process"], @@ -3339,7 +3310,6 @@ [10, "v1", "float"] ], "(trans idle fma-sphere)": [[39, "a2", "process-drawable"]], - "(method 10 talker)": [[29, "t9", "(function process none)"]], "(exit active talker)": [[19, "s5", "process-drawable"]], "(method 11 speech-channel)": [ [66, "v1", "process-drawable"], @@ -3433,7 +3403,6 @@ [46, "t6", "(pointer grid-hash-word)"] ], "(method 19 grid-hash)": [[46, "t6", "(pointer uint8)"]], - "(method 15 sphere-hash)": [[5, "v0", "(function grid-hash none)"]], "(method 32 sphere-hash)": [[107, "v1", "float"]], "(method 13 carry-info)": [ [14, "v1", "handle"], @@ -3541,9 +3510,6 @@ "(code die enemy)": [[30, "v1", "art-joint-anim"]], "(code die-falling enemy)": [[32, "gp", "art-joint-anim"]], "(code view-anims enemy)": [[20, "s4", "art-joint-anim"]], - "(method 7 enemy)": [ - [14, "t9", "(function process-focusable int process-focusable)"] - ], "nav-enemy-chase-post": [[[15, 19], "a0", "process-focusable"]], "nav-enemy-flee-post": [[[16, 20], "a0", "process-focusable"]], "nav-enemy-face-focus-post": [[[24, 28], "a0", "process-focusable"]], @@ -3573,17 +3539,11 @@ [18, "s5", "process-focusable"], [[35, 40], "s5", "process-focusable"] ], - "(method 32 youngsamos-npc)": [ - [61, "t9", "(function process-taskable none)"] - ], "(method 35 pecker-npc)": [ [58, "v1", "art-joint-anim"], [117, "v1", "art-joint-anim"] ], "(code idle scene-looper)": [[40, "gp", "handle"]], - "(method 7 rigid-body-platform)": [ - [14, "t9", "(function rigid-body-object int rigid-body-object)"] - ], "(method 53 rigid-body-platform)": [[24, "f0", "float"]], "(method 46 rigid-body-platform)": [ [13, "v1", "rigid-body-control-point"], @@ -3645,9 +3605,6 @@ [7, "s5", "nav-enemy"], [32, "a2", "nav-enemy"] ], - "(method 7 battle)": [ - [15, "t9", "(function process-drawable int process-drawable)"] - ], "(method 51 battle)": [[[38, 95], "s4", "enemy"]], "(method 26 battle)": [ [35, "a0", "connection"], @@ -4406,7 +4363,6 @@ [40, "s5", "process-focusable"], [13, "s5", "process-focusable"] ], - "(method 132 grunt)": [[16, "t9", "(function nav-enemy none)"]], "(method 77 flitter)": [ [14, "v1", "art-joint-anim"], [69, "v1", "art-joint-anim"] @@ -4428,7 +4384,6 @@ [20, "v1", "art-joint-anim"], [147, "v1", "art-joint-anim"] ], - "(method 132 flitter)": [[16, "t9", "(function nav-enemy none)"]], "(code target-tube)": [[33, "v1", "art-joint-anim"]], "(code target-tube-start)": [[109, "v1", "float"]], "(event slide-control-ride slide-control)": [ @@ -4590,9 +4545,6 @@ "(code idle hide-light)": [[10, "v1", "art-joint-anim"]], "(event impact turret-shot)": [[11, "s4", "process-drawable"]], "(code impact turret-shot)": [[4, "v1", "collide-shape-prim-group"]], - "(method 29 sinking-plat)": [ - [9, "t9", "(function rigid-body-platform float none)"] - ], "(code collapse beam)": [[25, "v1", "art-joint-anim"]], "(code fall ruins-bridge)": [ [16, "v1", "collide-shape-prim-group"], @@ -4811,7 +4763,6 @@ [40, "v1", "(inline-array tpath-control-frame)"] ], "(method 31 gun-dummy)": [[40, "v1", "(inline-array tpath-control-frame)"]], - "(method 10 training-manager)": [[51, "t9", "(function process none)"]], "(trans course training-manager)": [[[22, 493], "gp", "hud"]], "(code end-course training-manager)": [[28, "gp", "process-drawable"]], "(method 21 training-manager)": [ @@ -4865,7 +4816,6 @@ [39, "v0", "state"], [41, "t9", "(function none)"] ], - "(method 10 gem)": [[12, "t9", "(function gem none)"]], "(method 9 fact-info)": [ [245, "a0", "process-drawable"], [293, "a0", "process-drawable"], @@ -4899,7 +4849,6 @@ ], "(method 78 fodder)": [[16, "v1", "art-joint-anim"]], "(method 181 fodder)": [[2, "v1", "collide-shape-prim-group"]], - "(method 7 fodder)": [[19, "t9", "(function nav-enemy int nav-enemy)"]], "(post idle fodder)": [[4, "t9", "(function none)"]], "(method 180 fodder)": [[24, "s1", "fodder"]], "(method 55 fodder)": [[29, "s5", "process-drawable"]], @@ -5044,9 +4993,6 @@ [175, "s5", "process-drawable"], [[104, 219], "gp", "handle"] ], - "(method 10 hoverboard-training-manager)": [ - [19, "t9", "(function process none)"] - ], "(code fire skatea-jump-pad)": [[59, "t9", "(function none)"]], "(method 29 hoverboard-training-manager)": [[[18, 491], "gp", "hud-goal"]], "hoverboard-training-manager-event-handler": [ @@ -5139,10 +5085,6 @@ [48, "s2", "amphibian-joint-mod"], [49, "v1", "amphibian"] ], - "(method 7 hopper)": [ - [14, "t9", "(function process-focusable int process-focusable)"] - ], - "(method 132 hopper)": [[16, "t9", "(function enemy none)"]], "(code active hopper)": [[22, "v1", "art-joint-anim"]], "(trans hostile hopper)": [ [24, "gp", "process-focusable"], @@ -5160,9 +5102,6 @@ [33, "a1", "art-joint-anim"], [86, "a1", "art-joint-anim"] ], - "(method 7 metalmonk)": [ - [14, "t9", "(function process-focusable int process-focusable)"] - ], "(method 87 metalmonk)": [[27, "s5", "art-joint-anim"]], "(method 104 metalmonk)": [ [14, "a0", "process-focusable"], @@ -5208,7 +5147,6 @@ [16, "a0", "process-focusable"], [19, "a0", "process-focusable"] ], - "(method 10 ginsu)": [[6, "t9", "(function sparticle-launch-control none)"]], "(code victory centurion)": [[30, "v1", "art-joint-anim"]], "(code fire centurion)": [ [22, "a0", "process-focusable"], @@ -5241,9 +5179,6 @@ [87, "a0", "process-focusable"], [90, "a0", "process-focusable"] ], - "(method 7 centurion)": [ - [14, "t9", "(function process-focusable int process-focusable)"] - ], "(method 78 centurion)": [ [18, "v1", "art-joint-anim"], [53, "s4", "art-joint-anim"], @@ -5264,11 +5199,6 @@ [28, "s0", "process-focusable"], [49, "s0", "process-focusable"] ], - "(method 132 centurion)": [[13, "t9", "(function enemy none)"]], - "(method 31 centurion-shot)": [[7, "t9", "(function projectile none)"]], - "(method 28 centurion-shot)": [ - [49, "t9", "(function projectile projectile-options sound-id)"] - ], "(method 74 centurion)": [ [76, "v1", "attack-info"], [78, "v1", "attack-info"], @@ -5333,9 +5263,6 @@ [139, "gp", "process-focusable"], [293, "a0", "process-focusable"] ], - "(method 7 rhino)": [ - [14, "t9", "(function process-focusable int process-focusable)"] - ], "(method 74 rhino)": [[68, "s2", "process-focusable"]], "(method 182 rhino)": [[36, "s2", "process-drawable"]], "(exit victory rhino)": [ @@ -5398,9 +5325,6 @@ "(code spin-kick grenadier)": [[14, "v1", "art-joint-anim"]], "(enter spin-kick grenadier)": [[29, "v1", "collide-shape-prim-group"]], "(code backup grenadier)": [[10, "v1", "art-joint-anim"]], - "(method 7 grenadier)": [ - [21, "t9", "(function process-focusable int process-focusable)"] - ], "(method 70 grenadier)": [[41, "a0", "process-focusable"]], "(code active grenadier)": [ [140, "v1", "art-joint-anim"], @@ -5447,9 +5371,6 @@ [32, "a0", "process-focusable"], [35, "a0", "process-focusable"] ], - "(method 7 rapid-gunner)": [ - [14, "t9", "(function process-focusable int process-focusable)"] - ], "(exit spin-attack rapid-gunner)": [[13, "v1", "collide-shape-prim-group"]], "(post spin-attack rapid-gunner)": [ [24, "a0", "process-focusable"], @@ -5583,9 +5504,6 @@ [123, "v1", "art-joint-anim"], [155, "v1", "art-joint-anim"] ], - "(method 7 predator)": [ - [9, "t9", "(function process-focusable int process-focusable)"] - ], "(method 184 predator)": [ [67, "s2", "process-focusable"], [79, "a0", "process-focusable"], @@ -5675,9 +5593,6 @@ [21, "v1", "collide-shape-prim-group"] ], "(method 201 crimson-guard-level)": [[18, "s3", "process-focusable"]], - "(method 7 crimson-guard-level)": [ - [19, "t9", "(function nav-enemy int nav-enemy)"] - ], "(method 115 crimson-guard-level)": [[33, "v0", "vector"]], "(method 198 crimson-guard-level)": [[242, "s4", "collide-shape-prim"]], "(enter broken dig-clasp)": [ @@ -5693,9 +5608,6 @@ "(method 23 dig-digger)": [[[1, 23], "s5", "int"]], "(enter breaking fort-fence)": [[[5, 9], "a0", "collide-shape-prim-group"]], "(method 11 fort-elec-switch)": [["_stack_", 16, "res-tag"]], - "(method 10 fort-roboscreen)": [ - [15, "t9", "(function process-drawable none)"] - ], "fort-robotank-reticle-handler": [ [6, "v1", "vector"], [[17, 34], "s5", "vector"], @@ -5728,7 +5640,6 @@ [89, "t9", "(function fort-robotank none)"] ], "(method 7 fort-robotank)": [ - [89, "t9", "(function process-drawable int process-drawable)"], [56, "gp", "(pointer uint32)"], [59, "a1", "(pointer uint32)"], [63, "gp", "(pointer uint32)"], @@ -5762,26 +5673,17 @@ "(enter die fort-missile-target)": [ [[2, 5], "v1", "collide-shape-prim-group"] ], - "(method 10 fort-missile-target)": [ - [10, "t9", "(function process-drawable none)"] - ], "(code die fort-missile)": [ [156, "v1", "process-drawable"], [227, "v1", "collide-shape-prim-group"], [229, "v1", "collide-shape-prim-group"] ], - "(method 7 fort-missile)": [ - [14, "t9", "(function process-drawable int process-drawable)"] - ], "birth-func-dig-digger-collide": [ [8, "v1", "process"], [12, "s3", "process-drawable"] ], "(method 23 dig-tether)": [[69, "v1", "vector"]], "(method 11 dig-digger)": [["_stack_", 16, "res-tag"]], - "(method 29 dig-sinking-plat)": [ - [9, "t9", "(function rigid-body-platform float none)"] - ], "(method 37 dig-sinking-plat)": [ [28, "v1", "art-joint-anim"], [157, "v1", "art-joint-anim"], @@ -5808,9 +5710,6 @@ ], "(code fire dig-jump-pad)": [[59, "t9", "(function none)"]], "(code die dig-spikey-sphere)": [[72, "t9", "(function none)"]], - "(method 29 dig-tipping-rock)": [ - [9, "t9", "(function rigid-body-platform float none)"] - ], "(event waiting dig-stomp-block)": [[14, "v1", "attack-info"]], "(method 37 dig-stomp-block)": [ [[42, 62], "v1", "collide-cache-tri"], @@ -5819,7 +5718,6 @@ "(method 11 dig-spikey-step)": [[96, "v0", "(pointer float)"]], "(method 37 dig-tipping-rock)": [[14, "v0", "sound-rpc-set-param"]], "(method 49 cpad-elevator)": [[2, "v1", "collide-shape-prim-group"]], - "(method 10 cpad-elevator)": [[10, "t9", "(function elevator none)"]], "(code hunt wren)": [[10, "v1", "art-joint-anim"]], "(code peck wren)": [ [36, "v1", "art-joint-anim"], @@ -5830,9 +5728,6 @@ [82, "v1", "art-joint-anim"] ], "(code land wren)": [[17, "v1", "art-joint-anim"]], - "(method 7 wren)": [ - [30, "t9", "(function process-drawable int process-drawable)"] - ], "(code idle minnow)": [[10, "v1", "art-joint-anim"]], "(post idle fish-manager)": [ [517, "v1", "process-drawable"], @@ -5845,9 +5740,6 @@ [112, "s2", "entity-actor"], [93, "s2", "basic"] ], - "(method 3 engine-minimap)": [ - [7, "t9", "(function engine-minimap engine-minimap)"] - ], "(method 24 minimap)": [ [189, "s2", "connection-minimap"], [194, "s2", "connection-minimap"], @@ -5985,9 +5877,6 @@ ], "(method 137 sew-gunturret)": [[[19, 23], "a0", "process-focusable"]], "(method 138 sew-gunturret)": [[[15, 19], "a0", "process-focusable"]], - "(method 140 pal-gun-turret)": [ - [9, "t9", "(function sew-gunturret symbol none)"] - ], "(anon-function 0 sewer-scenes)": [[79, "v1", "float"]], "(event idle sew-single-blade)": [[15, "s4", "process-focusable"]], "(event idle sew-multi-blade)": [[15, "s4", "process-focusable"]], @@ -5997,11 +5886,7 @@ "sew-tri-blade-joint-callback": [[[1, 82], "gp", "sew-tri-blade"]], "(method 49 sew-elevator)": [[2, "v1", "collide-shape-prim-group"]], "(post running sew-elevator)": [[4, "t9", "(function none)"]], - "(method 10 sew-elevator)": [[10, "t9", "(function elevator none)"]], "(event idle sew-valve)": [[4, "v1", "attack-info"]], - "(method 7 sew-valve)": [ - [14, "t9", "(function process-drawable int process-drawable)"] - ], "sew-mar-statue-debris-init-by-other": [ [[144, 157], "gp", "process-drawable"] ], @@ -6078,9 +5963,6 @@ "(event idle grunt-egg)": [[16, "s4", "process-focusable"]], "strip-handler": [[15, "s4", "process-focusable"]], "(post idle pitspikes)": [[4, "t9", "(function none)"]], - "(method 7 pitspikes)": [ - [14, "t9", "(function strip-hazard int strip-hazard)"] - ], "(post idle curtainsaw)": [[4, "t9", "(function none)"]], "(event impact grenade)": [ [11, "s4", "process-drawable"], @@ -6110,12 +5992,6 @@ [169, "v1", "float"], [[118, 125], "s5", "traffic-object-spawn-params"] ], - "(method 33 citizen-norm-rider)": [ - [7, "t9", "(function vehicle-rider none)"] - ], - "(method 33 crimson-guard-rider)": [ - [7, "t9", "(function vehicle-rider none)"] - ], "(enter explode vehicle)": [[298, "v1", "joint-exploder"]], "(method 47 vehicle)": [ [27, "s0", "process-focusable"], @@ -6128,7 +6004,6 @@ ], "(method 97 vehicle)": [[6, "v1", "float"]], "(method 18 vehicle-controller)": [[231, "s2", "vehicle"]], - "(method 10 vehicle)": [[12, "t9", "(function rigid-body-object none)"]], "(method 119 vehicle)": [[[19, 45], "s4", "vehicle-rider"]], "(method 99 vehicle)": [[14, "s3", "collide-shape-prim-group"]], "(method 100 vehicle)": [[163, "a0", "vector"]], @@ -6313,7 +6188,6 @@ [457, "a0", "(array float)"] ], "(code idle tomb-spider)": [[[1, 9], "v1", "(pointer process)"]], - "(method 10 tomb-sphinx)": [[10, "t9", "(function process-drawable none)"]], "tomb-stair-block-spikes-init-by-other": [ [53, "s2", "pair"], [72, "s2", "pair"], @@ -6329,9 +6203,6 @@ "(event idle tomb-stair-block-spikes)": [[24, "v1", "vector"]], "(code moving tomb-stair-block)": [[40, "v1", "art-joint-anim"]], "(post running tomb-elevator)": [[8, "t9", "(function none)"]], - "(method 10 tomb-plat-return)": [ - [10, "t9", "(function process-drawable none)"] - ], "lift-pool": [ [12, "v0", "(pointer actor-group)"], ["_stack_", 16, "res-tag"] @@ -6618,9 +6489,6 @@ "(code die-falling ashelin)": [[108, "gp", "art-joint-anim"]], "(anon-function 0 ash1-course)": [[31, "v1", "asht-wait-spot"]], "ashelin-shot-move": [[49, "v1", "(state ashelin)"]], - "(method 28 ashelin-shot)": [ - [47, "t9", "(function projectile projectile-options none)"] - ], "(method 30 ashelin-shot)": [[119, "a0", "ashelin"]], "(anon-function 2 ash1-course)": [[50, "v1", "asht-wait-spot"]], "(anon-function 7 ash1-course)": [[90, "v1", "asht-wait-spot"]], @@ -6684,10 +6552,6 @@ [288, "v1", "art-joint-anim"], [143, "v1", "lightning-tracker"] ], - "(method 10 whack-a-metal)": [[24, "t9", "(function process none)"]], - "(method 7 whack-a-metal)": [ - [26, "t9", "(function process-drawable int process-drawable)"] - ], "(method 27 whack-a-metal)": [ [69, "a1", "hip-mole"], [78, "a1", "hip-mole"], @@ -6757,9 +6621,6 @@ [27, "a0", "process-focusable"], [83, "a1", "art-joint-anim"] ], - "(method 7 juicer)": [ - [19, "t9", "(function process-focusable int process-focusable)"] - ], "(method 184 juicer)": [[4, "v1", "collide-shape-prim-group"]], "(code circling juicer)": [ [228, "gp", "art-joint-anim"], @@ -6799,9 +6660,6 @@ [284, "a0", "process-focusable"] ], "(method 25 juicer-shot)": [[131, "a1", "int"]], - "(method 7 spyder)": [ - [31, "t9", "(function process-focusable int process-focusable)"] - ], "(code attack spyder)": [ [116, "a0", "process-focusable"], [119, "a0", "process-focusable"], @@ -6822,7 +6680,6 @@ [17, "a0", "process-focusable"], [20, "a0", "process-focusable"] ], - "(method 31 spyder-shot)": [[7, "t9", "(function projectile none)"]], "(code backup spyder)": [[22, "v1", "art-joint-anim"]], "(trans hostile spyder)": [ [20, "a0", "process-focusable"], @@ -6901,9 +6758,6 @@ [23, "a0", "process-focusable"], [26, "a0", "process-focusable"] ], - "(method 7 mammoth)": [ - [26, "t9", "(function process-focusable int process-focusable)"] - ], "(code waiting mammoth)": [[41, "v1", "art-joint-anim"]], "(code wait-to-walk mammoth)": [[18, "v1", "art-joint-anim"]], "(code walking mammoth)": [[74, "a1", "art-joint-anim"]], @@ -6933,9 +6787,6 @@ [19, "s0", "mammoth"], [3, "v1", "int"] ], - "(method 28 flying-spider-shot)": [ - [27, "t9", "(function projectile projectile-options sound-id)"] - ], "(code active flying-spider)": [[10, "v1", "art-joint-anim"]], "(code ambush flying-spider)": [[14, "v1", "art-joint-anim"]], "(code ambush-falling flying-spider)": [ @@ -6985,10 +6836,6 @@ [52, "v1", "art-joint-anim"], [82, "v1", "art-joint-anim"] ], - "(method 10 slider)": [[10, "t9", "(function process-drawable none)"]], - "(method 7 slider)": [ - [26, "t9", "(function process-drawable int process-drawable)"] - ], "(event idle slider)": [ [31, "s3", "process-focusable"], [34, "s3", "process-focusable"] @@ -7050,7 +6897,6 @@ [69, "v1", "float"], [257, "v1", "float"] ], - "(method 10 spydroid)": [[14, "t9", "(function process-focusable none)"]], "(trans hostile spydroid)": [ [29, "a0", "process-focusable"], [32, "a0", "process-focusable"] @@ -7097,22 +6943,12 @@ "(event idle widow-bomb)": [[77, "v1", "float"]], "(exit idle widow-bomb)": [[15, "v1", "float"]], "(trans idle widow-bomb)": [[262, "v1", "float"]], - "(method 10 widow-bomb)": [[42, "t9", "(function process-drawable none)"]], - "(method 7 widow-bomb)": [ - [39, "t9", "(function process-drawable int process-drawable)"] - ], "tomb-boss-pillar-shrink-collision": [ [2, "v1", "collide-shape-prim-group"], [7, "v1", "collide-shape-prim-group"] ], "(enter broken tomb-boss-pillar)": [[17, "v1", "art-joint-anim"]], "(enter idle tomb-boss-pillar)": [[2, "v1", "collide-shape-prim-group"]], - "(method 10 tomb-boss-pillar)": [ - [14, "t9", "(function process-drawable none)"] - ], - "(method 7 tomb-boss-pillar)": [ - [14, "t9", "(function process-drawable int process-drawable)"] - ], "(event idle tomb-boss-firepot)": [ [10, "gp", "widow-shot"], [15, "v1", "attack-info"], @@ -7213,10 +7049,6 @@ [57, "gp", "process-focusable"] ], "(method 34 transport)": [[22, "v1", "vehicle-turret"]], - "(method 10 transport)": [[10, "t9", "(function process-drawable none)"]], - "(method 7 vehicle-turret)": [ - [14, "t9", "(function process-drawable int process-drawable)"] - ], "(method 29 vehicle-turret)": [ [14, "s5", "process-drawable"], [26, "s5", "process-drawable"] @@ -7355,13 +7187,6 @@ ], "(event idle drill-control-panel)": [[4, "v1", "attack-info"]], "(code waiting drill-elevator)": [[14, "v1", "art-joint-anim"]], - "(method 10 drill-elevator)": [ - [10, "t9", "(function process-drawable none)"] - ], - "(method 7 fire-floor)": [ - [14, "t9", "(function process-drawable int process-drawable)"] - ], - "(method 10 fire-floor)": [[17, "t9", "(function process-drawable none)"]], "(event idle fire-floor)": [ [18, "gp", "process-focusable"], [51, "gp", "process-focusable"], @@ -7382,17 +7207,16 @@ [14, "v1", "art-joint-anim"], [118, "v1", "art-joint-anim"] ], + "(post running drill-lift)": [ + [16, "v0", "state"], + [18, "t9", "(function none)"] + ], "(post running drill-elevator)": [[4, "t9", "(function none)"]], "(method 11 drill-laser)": [ ["_stack_", 16, "res-tag"], [42, "v0", "(pointer float)"] ], "(method 49 drill-lift)": [[2, "v1", "collide-shape-prim-group"]], - "(post running drill-lift)": [ - [16, "v0", "state"], - [18, "t9", "(function none)"] - ], - "(exit running drill-lift)": [[22, "v0", "state"]], "(code idle drill-moving-staircase)": [[10, "v1", "art-joint-anim"]], "(post idle drill-moving-staircase)": [[4, "t9", "(function none)"]], "(code swing-up drill-flip-step)": [[10, "v1", "art-joint-anim"]], @@ -7436,9 +7260,6 @@ [1, "v1", "(pointer race-ring)"] ], "(method 11 under-shoot-block)": [["_stack_", 16, "res-tag"]], - "(method 10 under-shoot-block)": [ - [62, "t9", "(function process-drawable none)"] - ], "under-block-event-handler": [ [23, "gp", "attack-info"], [28, "gp", "attack-info"], @@ -7457,7 +7278,6 @@ [30, "v1", "collide-shape-prim-group"] ], "(event idle under-break-door)": [[13, "v1", "attack-info"]], - "(method 10 under-lift)": [[10, "t9", "(function process-drawable none)"]], "(event waiting under-buoy-plat)": [[4, "v1", "attack-info"]], "(trans idle under-buoy-chain)": [[6, "v1", "process-drawable"]], "(code idle under-warp)": [[38, "v1", "art-joint-anim"]], @@ -7476,9 +7296,6 @@ [74, "v0", "(pointer float)"], ["_stack_", 16, "res-tag"] ], - "(method 29 under-buoy-plat)": [ - [9, "t9", "(function rigid-body-object float none)"] - ], "(method 49 under-lift)": [[2, "v1", "collide-shape-prim-group"]], "(post running under-lift)": [[4, "t9", "(function none)"]], "(code ambush pipe-grunt)": [[23, "a1", "art-joint-anim"]], @@ -7694,9 +7511,6 @@ [88, "gp", "process-focusable"], [119, "gp", "process-focusable"] ], - "(method 7 cty-guard-turret)": [ - [24, "t9", "(function process-focusable int process-focusable)"] - ], "(method 21 parking-spot)": [[[13, 38], "s5", "vehicle"]], "(event idle propa)": [ [[12, 15], "v1", "attack-info"], @@ -7710,9 +7524,6 @@ [26, "a0", "collide-shape"], [32, "s0", "process-focusable"] ], - "(method 7 barons-ship-lores)": [ - [24, "t9", "(function process-drawable int process-drawable)"] - ], "(event idle ctyn-lamp)": [[4, "a0", "process-drawable"]], "fruit-check-ground-bounce": [[[5, 40], "v1", "fruit-stand"]], "fruit-stand-event-handler": [[[5, 8], "v1", "attack-info"]], @@ -7725,17 +7536,6 @@ "tanker-deadly-init-by-other": [[70, "v1", "process-drawable"]], "(post idle vin-turbine)": [[205, "a0", "lightning-tracker"]], "(method 49 com-elevator)": [[2, "v1", "collide-shape-prim-group"]], - "(enter dormant com-elevator)": [ - [4, "v0", "state"], - [6, "t9", "(function none)"] - ], - "(method 10 com-elevator)": [[10, "t9", "(function elevator none)"]], - "(method 10 tomb-trans-elevator)": [ - [10, "t9", "(function com-elevator none)"] - ], - "(method 33 tomb-trans-elevator)": [ - [7, "t9", "(function com-elevator none)"] - ], "(anon-function 4 ctypower)": [[137, "gp", "process-drawable"]], "(anon-function 0 ctypower)": [ [19, "a0", "vector"], @@ -7751,9 +7551,6 @@ [6, "t9", "(function none)"] ], "(code idle intro-flamer)": [[18, "v1", "art-joint-anim"]], - "(method 7 metalhead-spawner)": [ - [26, "t9", "(function process int process)"] - ], "(event idle farm-marrow)": [[[8, 11], "a1", "attack-info"]], "(event idle farm-beetree)": [[[8, 11], "a1", "attack-info"]], "(event idle farm-cabbage)": [[[8, 11], "a1", "attack-info"]], @@ -7837,7 +7634,6 @@ [63, "v1", "art-joint-anim"], [134, "v1", "art-joint-anim"] ], - "(method 10 stad-samos)": [[42, "t9", "(function process-focusable none)"]], "(method 29 stad-force-field)": [ [155, "v1", "process-drawable"], [418, "v1", "process-drawable"], @@ -7856,10 +7652,6 @@ "(event idle stad-force-field)": [[[9, 12], "v1", "attack-info"]], "(post idle stad-keira)": [[14, "v0", "vector"]], "(post idle stad-brutter)": [[14, "v0", "vector"]], - "(method 10 rift-rider)": [[10, "t9", "(function rigid-body-object none)"]], - "(method 45 rift-rider)": [ - [30, "t9", "(function rigid-body-object rigid-body-impact none)"] - ], "(code fall pal-falling-plat)": [ [10, "v1", "art-joint-anim"], [70, "v1", "art-joint-anim"] @@ -7869,9 +7661,6 @@ [20, "v0", "vector"], [263, "s2", "collide-shape-prim-sphere"] ], - "(method 10 fort-elec-belt-inst)": [ - [10, "t9", "(function process-drawable none)"] - ], "(method 11 fort-elec-belt)": [[20, "v0", "(pointer float)"]], "(method 10 rigid-body-queue)": [ [[124, 134], "a0", "rigid-body-object"], @@ -7879,7 +7668,6 @@ [20, "a0", "rigid-body-object"] ], "(method 15 hud)": [[[125, 128], "v1", "dma-packet"]], - "(method 10 cas-conveyor)": [[10, "t9", "(function conveyor none)"]], "(post idle cas-conveyor)": [ [58, "t9", "(function none)"], [45, "v1", "float"] @@ -7893,7 +7681,6 @@ [15, "v0", "sound-rpc-set-param"] ], "(post arrived cas-elevator)": [[11, "t9", "(function none)"]], - "(method 10 cas-elevator)": [[10, "t9", "(function elevator none)"]], "(code idle cas-rot-bridge)": [ [40, "v1", "art-joint-anim"], [98, "v1", "art-joint-anim"], @@ -7912,24 +7699,13 @@ "(event idle cas-trapdoor)": [[10, "gp", "attack-info"]], "(code drop cas-chain-plat)": [[10, "v1", "art-joint-anim"]], "(event idle cas-rot-blade)": [[7, "s4", "touching-shapes-entry"]], - "(method 10 cas-rot-blade)": [[10, "t9", "(function process-drawable none)"]], "(code spawning cas-robot-door)": [ [27, "v1", "art-joint-anim"], [417, "v1", "art-joint-anim"] ], "(enter ambush roboguard-level)": [ - [4, "v0", "state"], - [6, "t9", "(function none)"], [[72, 76], "a0", "process-focusable"] ], - "(enter idle roboguard-level)": [ - [4, "v0", "state"], - [6, "t9", "(function none)"] - ], - "(enter stare roboguard-level)": [ - [4, "v0", "state"], - [6, "t9", "(function none)"] - ], "(code roll-enter roboguard-level)": [[10, "v1", "art-joint-anim"]], "(trans roll-hostile roboguard-level)": [ [120, "gp", "process-focusable"], @@ -7938,10 +7714,6 @@ ], "(code roll-to-walk roboguard-level)": [[10, "v1", "art-joint-anim"]], "(code idle-dizzy roboguard-level)": [[14, "v1", "art-joint-anim"]], - "(enter die roboguard-level)": [ - [4, "v0", "state"], - [6, "t9", "(function none)"] - ], "(method 185 roboguard-level)": [ [[5, 28], "v1", "collide-shape-prim-group"], [[42, 65], "v1", "collide-shape-prim-group"], @@ -7960,10 +7732,6 @@ [42, "s1", "process-drawable"], [58, "s1", "process-drawable"] ], - "(method 10 roboguard-level)": [[10, "t9", "(function nav-enemy none)"]], - "(method 7 roboguard-level)": [ - [9, "t9", "(function nav-enemy int nav-enemy)"] - ], "(code castle-wait-end cas-robot-door)": [[32, "v1", "art-joint-anim"]], "(method 11 cas-robot-door)": [ ["_stack_", 16, "res-tag"], @@ -7993,7 +7761,6 @@ ], "(code hostile bombbot)": [[11, "v1", "art-joint-anim"]], "(code die bombbot)": [[11, "v1", "art-joint-anim"]], - "(method 7 bombbot)": [[31, "t9", "(function nav-enemy int nav-enemy)"]], "(anon-function 8 bombbot)": [[17, "s2", "bombbot"]], "(anon-function 1 bombbot)": [[15, "s4", "bombbot"]], "bombbot-callback": [[[2, 190], "s4", "bombbot"]], @@ -8007,7 +7774,6 @@ "(method 11 cas-switch)": [["_stack_", 16, "res-tag"]], "(method 11 cas-conveyor)": [["_stack_", 16, "res-tag"]], "(method 11 cas-conveyor-switch)": [["_stack_", 16, "res-tag"]], - "(method 7 hover-formation)": [[19, "t9", "(function basic int basic)"]], "(method 11 hover-formation-control)": [[38, "s3", "process-focusable"]], "(method 16 hover-formation-control)": [[25, "s3", "process-focusable"]], "(method 13 hover-formation-control)": [ @@ -8030,7 +7796,6 @@ [49, "a0", "(pointer int32)"], [51, "a0", "(array object)"] ], - "(method 7 nav-graph-editor)": [[9, "t9", "(function process int none)"]], "(method 18 traffic-tracker)": [ [[8, 12], "a1", "handle"], [[11, 19], "a0", "handle"] @@ -8061,15 +7826,9 @@ [254, "v1", "mysql-nav-edge"] ], "(method 11 city-level-info)": [[27, "a3", "(pointer int8)"]], - "(method 36 bike-base)": [[7, "t9", "(function object none)"]], "(method 85 bike-base)": [ - [7, "t9", "(function object none)"], [[22, 26], "v1", "(pointer uint128)"] ], - "(method 7 bikea)": [[44, "t9", "(function object int bikea)"]], - "(method 7 bikeb)": [[49, "t9", "(function object int bikeb)"]], - "(method 7 bikec)": [[64, "t9", "(function object int bikec)"]], - "(method 7 guard-bike)": [[14, "t9", "(function object int guard-bike)"]], "target-pilot-exit": [[64, "gp", "vehicle"]], "target-pilot-init": [ [[61, 68], "s4", "vehicle"], @@ -8104,10 +7863,6 @@ [[28, 33], "a0", "vehicle"], [103, "a0", "process"] ], - "(method 7 cara)": [[54, "t9", "(function object object cara)"]], - "(method 7 carb)": [[39, "t9", "(function object object carb)"]], - "(method 7 carc)": [[44, "t9", "(function object object carb)"]], - "(method 7 hellcat)": [[14, "t9", "(function object object hellcat)"]], "(code in-ditch citizen)": [ [23, "v1", "art-joint-anim"], [122, "v1", "art-joint-anim"] @@ -8289,9 +8044,6 @@ [450, "v1", "process-focusable"] ], "(code get-up-front crimson-guard)": [[20, "v1", "art-joint-anim"]], - "(method 7 crimson-guard)": [ - [19, "t9", "(function process-drawable int process-drawable)"] - ], "(code attack crimson-guard)": [ [351, "a0", "process-focusable"], [380, "v1", "art-joint-anim"], @@ -8462,9 +8214,6 @@ [66, "v0", "vector"], [56, "gp", "process-focusable"] ], - "(method 7 metalhead-predator)": [ - [9, "t9", "(function process-drawable int process-drawable)"] - ], "(method 205 metalhead-predator)": [[4, "v1", "collide-shape-prim-group"]], "(code close-attack metalhead-predator)": [ [15, "v1", "art-joint-anim"], @@ -8631,15 +8380,7 @@ "hover-enemy-manager-post": [ [6, "t9", "(function hover-formation-control none)"] ], - "(method 7 hover-enemy-manager)": [ - [21, "t9", "(function process int process)"] - ], - "(method 35 turret)": [[55, "t9", "(function base-turret none)"]], - "(enter die turret)": [[11, "v0", "(state base-turret)"]], - "(exit active turret)": [[4, "v0", "(state base-turret)"]], "(post active turret)": [ - [4, "v0", "(state base-turret)"], - [6, "t9", "(function none)"], [112, "v0", "int"], [134, "v0", "int"], [157, "v0", "int"] @@ -8667,8 +8408,7 @@ "(method 78 wasp)": [[11, "v1", "art-joint-anim"]], "(trans hostile wasp)": [[36, "v1", "art-joint-anim"]], "(method 52 wasp)": [ - [21, "a1", "process-focusable"], - [99, "t9", "(function enemy vector none)"] + [21, "a1", "process-focusable"] ], "(method 115 crimson-guard-hover)": [ ["_stack_", 16, "res-tag"], @@ -8680,59 +8420,33 @@ [162, "v0", "(pointer float)"], [188, "v0", "(pointer float)"] ], - "(enter flying-death crimson-guard-hover)": [ - [4, "v0", "(state hover-enemy)"] - ], "(code knocked-recover crimson-guard-hover)": [[20, "v1", "art-joint-anim"]], "(code attack crimson-guard-hover)": [[56, "v1", "art-joint-anim"]], "(trans hostile crimson-guard-hover)": [[22, "gp", "process-focusable"]], - "(enter flying-death-explode crimson-guard-hover)": [ - [4, "v0", "(state hover-enemy)"] - ], + "(post notice crimson-guard-hover)": [[4, "t9", "(function none)"]], + "(post ambush-attack crimson-guard-hover)": [[66, "t9", "(function none)"]], "(code flying-death crimson-guard-hover)": [ [17, "v1", "art-joint-anim"], [70, "v1", "art-joint-anim"] ], - "(enter knocked crimson-guard-hover)": [[4, "v0", "(state hover-enemy)"]], "(post kick-attack crimson-guard-hover)": [ [34, "a0", "process-focusable"], [37, "a0", "process-focusable"] ], - "(post notice crimson-guard-hover)": [[4, "t9", "(function none)"]], - "(post ambush-attack crimson-guard-hover)": [[66, "t9", "(function none)"]], "(code ambush-attack crimson-guard-hover)": [[37, "v1", "art-joint-anim"]], "(trans ambush-fly crimson-guard-hover)": [[47, "gp", "process-focusable"]], "(method 74 crimson-guard-hover)": [ [9, "v1", "attack-info"], - [ - 124, - "t9", - "(function enemy process int symbol event-message-block object)" - ], [131, "a0", "symbol"], [132, "v1", "process-focusable"], - [135, "v1", "process-focusable"], - [ - 170, - "t9", - "(function enemy process int symbol event-message-block object)" - ], - [ - 182, - "t9", - "(function enemy process int symbol event-message-block object)" - ] + [135, "v1", "process-focusable"] ], "(method 162 crimson-guard-hover)": [ [31, "a0", "process-focusable"], [34, "a0", "process-focusable"] ], "(method 52 crimson-guard-hover)": [ - [21, "a1", "process-focusable"], - [99, "t9", "(function hover-enemy vector none)"] - ], - "(method 135 crimson-guard-hover)": [ - [34, "t9", "(function enemy int sound-id)"] + [21, "a1", "process-focusable"] ], "(method 77 crimson-guard-hover)": [ [19, "v1", "art-joint-anim"], @@ -8744,9 +8458,6 @@ [64, "v1", "art-joint-anim"], [95, "v1", "art-joint-anim"] ], - "(method 7 flamer)": [ - [14, "t9", "(function process-drawable int process-drawable)"] - ], "(method 74 flamer)": [[78, "v1", "vector"]], "(trans hostile flamer)": [ [20, "a0", "process-focusable"], @@ -8784,7 +8495,6 @@ [47, "a0", "list-node"] ], "(method 13 hover-nav-control)": [["_stack_", 144, "float"]], - "(method 10 jellyfish)": [[10, "t9", "(function process-drawable none)"]], "(code grab-mech jellyfish)": [ [48, "v1", "art-joint-anim"], [155, "v1", "art-joint-anim"], @@ -8836,14 +8546,10 @@ [28, "v1", "drill-barons-ship"] ], "drill-barons-ship-explode-init-by-other": [[25, "a0", "process-drawable"]], - "(method 31 drill-ship-shot)": [[7, "t9", "(function guard-shot none)"]], "drill-barons-ship-turret-init-by-other": [ [117, "a0", "drill-barons-ship"], [126, "v1", "drill-barons-ship"] ], - "(method 7 drill-barons-ship-turret)": [ - [30, "t9", "(function process-drawable int process-drawable)"] - ], "(trans going-down drill-barons-ship-turret)": [ [9, "a1", "drill-barons-ship"], [14, "v1", "drill-barons-ship"], @@ -8885,9 +8591,6 @@ ["_stack_", 16, "res-tag"] ], "(post running cboss-elevator)": [[4, "t9", "(function none)"]], - "(method 10 cboss-elevator)": [ - [10, "t9", "(function process-drawable none)"] - ], "(method 77 krew-boss)": [[45, "v1", "art-joint-anim"]], "(method 78 krew-boss)": [[28, "v1", "art-joint-anim"]], "(method 74 krew-boss-clone)": [[98, "v1", "art-joint-anim"]], @@ -8898,7 +8601,6 @@ [69, "v1", "art-joint-anim"] ], "(enter die krew-boss-clone)": [[86, "v1", "collectable"]], - "(method 31 krew-boss-shot)": [[7, "t9", "(function projectile none)"]], "(code die krew-boss)": [[41, "v1", "art-joint-anim"]], "(trans hostile krew-boss)": [ [14, "a0", "process-focusable"], @@ -9536,10 +9238,6 @@ [41, "v1", "race-mesh-slice"], [45, "v1", "race-path-edge-info"] ], - "(method 7 vehicle-race-bike)": [ - [14, "t9", "(function process-drawable int process-drawable)"] - ], - "(method 10 race-manager)": [[30, "t9", "(function process none)"]], "(method 18 race-state)": [[111, "a3", "process-drawable"]], "(method 11 race-state)": [ [131, "s5", "process-focusable"], @@ -9557,7 +9255,6 @@ "(method 21 race-manager)": [[127, "s2", "race-racer-info"]], "(code fall pal-flip-step)": [[10, "v1", "art-joint-anim"]], "(method 11 pal-flip-step)": [[121, "v1", "art-joint-anim"]], - "(method 10 pal-rot-gun)": [[13, "t9", "(function process-drawable none)"]], "(event idle pal-electric-fan)": [ [29, "gp", "process-focusable"], [67, "gp", "process-focusable"] @@ -9596,9 +9293,6 @@ [64, "v1", "art-joint-anim"], [116, "v1", "art-joint-anim"] ], - "(method 10 forest-youngsamos)": [ - [40, "t9", "(function process-focusable none)"] - ], "forest-youngsamos-bounce-reaction": [[18, "v0", "(array sound-name)"]], "defend-stadium-rift-rider-handler": [ [96, "s4", "process-drawable"], @@ -9613,7 +9307,6 @@ ["_stack_", 16, "res-tag"], ["_stack_", 32, "res-tag"] ], - "(method 7 hosehead)": [[31, "t9", "(function process-drawable int none)"]], "(code debug-control hosehead)": [[20, "v1", "art-joint-anim"]], "(code notice hosehead)": [ [33, "v1", "art-joint-anim"], diff --git a/decompiler/types2/ForwardProp.cpp b/decompiler/types2/ForwardProp.cpp index 32423097ac..4cf1fc8712 100644 --- a/decompiler/types2/ForwardProp.cpp +++ b/decompiler/types2/ForwardProp.cpp @@ -138,6 +138,8 @@ std::optional try_get_type_symbol_val(const std::string& name, return TP_Type::make_run_function_in_process_function(); } else if (name == "set-to-run" && env.func->name() != "enter-state") { return TP_Type::make_set_to_run_function(); + } else if (name == "find-parent-method") { + return TP_Type::make_find_parent_method_function(); } // look up the type of the symbol @@ -2441,10 +2443,6 @@ void CallOp::propagate_types2(types2::Instruction& instr, in_type = TypeSpec("function", new_arg_types); } - if (in_type.arg_count() < 1) { - throw std::runtime_error("Called a function, but we do not know its type"); - } - // special case: variable argument count if (in_type.arg_count() == 2 && in_type.get_arg(0) == TypeSpec("_varargs_")) { can_backprop = false; // for now... can special case this later. @@ -2510,12 +2508,79 @@ void CallOp::propagate_types2(types2::Instruction& instr, arg_type.print()); } } + bool use_normal_last_arg = true; + + if (in_tp.kind == TP_Type::Kind::FIND_PARENT_METHOD_FUNCTION) { + printf("in for %s\n", env.func->name().c_str()); + bool can_use_call_parent = true; + TypeSpec call_parent_result_type; + const auto& guessed_name = env.func->guessed_name; + + if (guessed_name.kind == FunctionName::FunctionKind::METHOD || + guessed_name.kind == FunctionName::FunctionKind::V_STATE) { + // should call something like: + // (find-parent-method sharkey 39) + const auto& type_arg = input_types[Register(Reg::GPR, arg_regs[0])]->type; + if (can_use_call_parent && type_arg->kind != TP_Type::Kind::TYPE_OF_TYPE_NO_VIRTUAL) { + lg::warn( + "Can't use call-parent-method because the first argument to find-parent-method is a " + "{}, which should be a type", + type_arg->print()); + can_use_call_parent = false; + } + + if (can_use_call_parent && type_arg->get_type_objects_typespec() != guessed_name.type_name) { + lg::warn( + "Can't use call-parent-method because the first argument type is wrong: got {}, but " + "expected {}", + type_arg->get_type_objects_typespec().print(), guessed_name.type_name); + can_use_call_parent = false; + } + const auto& id_arg = input_types[Register(Reg::GPR, arg_regs[1])]->type; + int expected_id = -1; + if (guessed_name.kind == FunctionName::FunctionKind::V_STATE) { + auto state_info = dts.ts.lookup_method(guessed_name.type_name, guessed_name.state_name); + expected_id = state_info.id; + call_parent_result_type = + state_info.type.substitute_for_method_call(guessed_name.type_name); + } else { + expected_id = guessed_name.method_id; + call_parent_result_type = env.func->type; // same type as this method! + } + if (can_use_call_parent && !id_arg->is_integer_constant(expected_id)) { + lg::warn( + "Can't use call-parent-method because the second argument is wrong: got {}, but " + "expected a constant integer {}", + id_arg->print(), expected_id); + can_use_call_parent = false; + } + + } else { + can_use_call_parent = false; + lg::warn( + "Can't use call-parent-method because find-parent-method was called in {}, which isn't a " + "method or state handler.", + env.func->name()); + } + + if (can_use_call_parent) { + out_types[Register(Reg::GPR, Reg::V0)]->type = TP_Type::make_from_ts(call_parent_result_type); + printf("used special %s\n", call_parent_result_type.print().c_str()); + use_normal_last_arg = false; + } + } + + if (in_type.arg_count() < 1) { + throw std::runtime_error("Called a function, but we do not know its type"); + } + + if (use_normal_last_arg) { + out_types[Register(Reg::GPR, Reg::V0)]->type = TP_Type::make_from_ts(in_type.last_arg()); + } // set the call type! m_call_type = in_type; m_call_type_set = true; - out_types[Register(Reg::GPR, Reg::V0)]->type = TP_Type::make_from_ts(in_type.last_arg()); - if (in_tp.kind == TP_Type::Kind::NON_OBJECT_NEW_METHOD && in_tp.method_from_type() == TypeSpec("array") && input_types[Register(Reg::GPR, arg_regs[2])]) { diff --git a/goal_src/jak2/engine/ai/enemy.gc b/goal_src/jak2/engine/ai/enemy.gc index db365916a6..c3395fd247 100644 --- a/goal_src/jak2/engine/ai/enemy.gc +++ b/goal_src/jak2/engine/ai/enemy.gc @@ -24,15 +24,11 @@ ) ) -;; WARN: Return type mismatch process-focusable vs enemy. (defmethod relocate enemy ((obj enemy) (arg0 int)) (if (nonzero? (-> obj neck)) (&+! (-> obj neck) arg0) ) - (the-as - enemy - ((the-as (function process-focusable int process-focusable) (find-parent-method enemy 7)) obj arg0) - ) + (call-parent-method obj arg0) ) (defmethod get-rand-float enemy ((obj enemy)) diff --git a/goal_src/jak2/engine/ambient/ambient.gc b/goal_src/jak2/engine/ambient/ambient.gc index 72ac17881a..f6476c4cac 100644 --- a/goal_src/jak2/engine/ambient/ambient.gc +++ b/goal_src/jak2/engine/ambient/ambient.gc @@ -259,7 +259,7 @@ (defmethod deactivate talker ((obj talker)) (send-event (handle->process (-> obj voicebox)) 'die) - ((the-as (function process none) (find-parent-method talker 10)) obj) + (call-parent-method obj) (none) ) diff --git a/goal_src/jak2/engine/common_objs/collectables.gc b/goal_src/jak2/engine/common_objs/collectables.gc index 6280b51e82..33c3d1223d 100644 --- a/goal_src/jak2/engine/common_objs/collectables.gc +++ b/goal_src/jak2/engine/common_objs/collectables.gc @@ -1229,7 +1229,7 @@ (if (not (logtest? (-> self fact options) (actor-option no-reaction))) (send-event (handle->process arg1) 'powerup (-> self fact pickup-type) (-> self fact pickup-amount)) ) - (let ((t9-2 (-> (the-as state (find-parent-method eco 26)) code))) + (let ((t9-2 (-> (the-as state (find-parent-state)) code))) (if t9-2 ((the-as (function none) t9-2)) ) @@ -1666,7 +1666,7 @@ This commonly includes things such as: (defmethod deactivate gem ((obj gem)) (+! (-> *game-info* live-gem-count) -1) - ((the-as (function gem none) (find-parent-method gem 10)) obj) + (call-parent-method obj) (none) ) diff --git a/goal_src/jak2/engine/common_objs/conveyor.gc b/goal_src/jak2/engine/common_objs/conveyor.gc index 6dbfff7e29..f6bd112b3f 100644 --- a/goal_src/jak2/engine/common_objs/conveyor.gc +++ b/goal_src/jak2/engine/common_objs/conveyor.gc @@ -57,13 +57,9 @@ ) -;; WARN: Return type mismatch process-drawable vs conveyor. (defmethod relocate conveyor ((obj conveyor) (new-addr int)) (&+! (-> obj sections) new-addr) - (the-as - conveyor - ((the-as (function process-drawable int process-drawable) (find-parent-method conveyor 7)) obj new-addr) - ) + (call-parent-method obj new-addr) ) ;; WARN: Return type mismatch symbol vs art-group. diff --git a/goal_src/jak2/engine/common_objs/elevator.gc b/goal_src/jak2/engine/common_objs/elevator.gc index 3c30cefd7d..1f13c8a866 100644 --- a/goal_src/jak2/engine/common_objs/elevator.gc +++ b/goal_src/jak2/engine/common_objs/elevator.gc @@ -760,12 +760,11 @@ For example for an elevator pre-compute the distance between the first and last (none) ) -;; WARN: Return type mismatch base-plat vs elevator. (defmethod relocate elevator ((obj elevator) (arg0 int)) (if (nonzero? (-> obj path-seq)) (&+! (-> obj path-seq) arg0) ) - (the-as elevator ((the-as (function base-plat int base-plat) (find-parent-method elevator 7)) obj arg0)) + (call-parent-method obj arg0) ) (defmethod activate-elevator elevator ((obj elevator)) diff --git a/goal_src/jak2/engine/common_objs/rigid-body-plat.gc b/goal_src/jak2/engine/common_objs/rigid-body-plat.gc index 35b976f9ce..0e40cda4b7 100644 --- a/goal_src/jak2/engine/common_objs/rigid-body-plat.gc +++ b/goal_src/jak2/engine/common_objs/rigid-body-plat.gc @@ -73,18 +73,11 @@ ) -;; WARN: Return type mismatch rigid-body-object vs rigid-body-platform. (defmethod relocate rigid-body-platform ((obj rigid-body-platform) (new-addr int)) (if (nonzero? (-> obj control-point-array)) (&+! (-> obj control-point-array) new-addr) ) - (the-as - rigid-body-platform - ((the-as (function rigid-body-object int rigid-body-object) (find-parent-method rigid-body-platform 7)) - obj - new-addr - ) - ) + (call-parent-method obj new-addr) ) (defmethod rigid-body-platform-method-53 rigid-body-platform ((obj rigid-body-platform) (arg0 vector)) diff --git a/goal_src/jak2/engine/common_objs/water-anim.gc b/goal_src/jak2/engine/common_objs/water-anim.gc index 2cceec54c0..47e09d39db 100644 --- a/goal_src/jak2/engine/common_objs/water-anim.gc +++ b/goal_src/jak2/engine/common_objs/water-anim.gc @@ -45,7 +45,7 @@ (if (nonzero? (-> obj flow)) (&+! (-> obj flow) arg0) ) - ((the-as (function water-anim int water-anim) (find-parent-method water-anim 7)) obj arg0) + (call-parent-method obj arg0) ) (defskelgroup skel-water-anim-nest-dark-eco-largepool water-anim-nest-dark-eco water-anim-nest-dark-eco-largepool-lod0-jg -1 diff --git a/goal_src/jak2/engine/common_objs/water-flow.gc b/goal_src/jak2/engine/common_objs/water-flow.gc index 334bc61f39..ae4872cbfc 100644 --- a/goal_src/jak2/engine/common_objs/water-flow.gc +++ b/goal_src/jak2/engine/common_objs/water-flow.gc @@ -68,7 +68,7 @@ (if (nonzero? (-> obj path)) (&+! (-> obj path) arg0) ) - ((the-as (function flow-control int flow-control) (find-parent-method flow-control 7)) obj arg0) + (call-parent-method obj arg0) ) (defmethod draw-path flow-control ((obj flow-control)) diff --git a/goal_src/jak2/engine/debug/editable.gc b/goal_src/jak2/engine/debug/editable.gc index 726b37ddb4..8fd94e4f6c 100644 --- a/goal_src/jak2/engine/debug/editable.gc +++ b/goal_src/jak2/engine/debug/editable.gc @@ -736,10 +736,7 @@ ) ) ) - ((the-as (function editable-point editable-command none) (find-parent-method editable-point 28)) - obj - (the-as editable-command arg0) - ) + (call-parent-method obj arg0) 0 (none) ) @@ -1038,7 +1035,7 @@ ;; WARN: Function (method 25 editable-light) has a return type of none, but the expression builder found a return statement. (defmethod editable-method-25 editable-light ((obj editable-light) (arg0 editable-array)) - ((the-as (function editable-light editable-array none) (find-parent-method editable-light 25)) obj arg0) + (call-parent-method obj arg0) (when (nonzero? (-> obj id)) (let ((s5-1 (clear *temp-string*))) (format s5-1 "delete from light where light_id=~D" (-> obj id)) @@ -1197,7 +1194,7 @@ (set! (-> s3-0 owner) (delete! obj (-> s3-0 owner))) ) ) - ((the-as (function editable-face editable-array none) (find-parent-method editable-face 25)) obj arg0) + (call-parent-method obj arg0) (none) ) @@ -1225,13 +1222,7 @@ ;; WARN: Return type mismatch editable-face vs editable. (defmethod editable-method-27 editable-face ((obj editable-face) (arg0 editable-array)) - (let ((gp-1 - (the-as - editable-face - ((the-as (function editable-face editable-array editable) (find-parent-method editable-face 27)) obj arg0) - ) - ) - ) + (let ((gp-1 (the-as editable-face (call-parent-method obj arg0)))) (dotimes (s4-0 (-> gp-1 length)) (set! (-> gp-1 vertex s4-0) (the-as editable-point (editable-method-27 (-> gp-1 vertex s4-0) arg0))) (set! (-> gp-1 vertex s4-0 owner) (cons gp-1 (-> gp-1 vertex s4-0 owner))) diff --git a/goal_src/jak2/engine/debug/nav/nav-graph-editor.gc b/goal_src/jak2/engine/debug/nav/nav-graph-editor.gc index 0effc984f2..46cb8c9035 100644 --- a/goal_src/jak2/engine/debug/nav/nav-graph-editor.gc +++ b/goal_src/jak2/engine/debug/nav/nav-graph-editor.gc @@ -162,12 +162,8 @@ (none) ) -;; WARN: Return type mismatch none vs nav-graph-editor. (defmethod relocate nav-graph-editor ((obj nav-graph-editor) (arg0 int)) - (the-as - nav-graph-editor - ((the-as (function process int none) (find-parent-method nav-graph-editor 7)) obj arg0) - ) + (call-parent-method obj arg0) ) ;; WARN: Return type mismatch symbol vs none. diff --git a/goal_src/jak2/engine/game/task/task-control.gc b/goal_src/jak2/engine/game/task/task-control.gc index cef814c1a0..d4edce8bec 100644 --- a/goal_src/jak2/engine/game/task/task-control.gc +++ b/goal_src/jak2/engine/game/task/task-control.gc @@ -1683,7 +1683,6 @@ ) ) -;; WARN: Return type mismatch process vs none. (defmethod deactivate fail-mission ((obj fail-mission)) (set-filter-color! 1.0 1.0 1.0) (sound-group-continue (sound-group sfx music dialog sog3 ambient dialog2 sog6 sog7)) @@ -1691,7 +1690,7 @@ (update-rates! (-> *display* entity-clock) 1.0) (update-rates! (-> *display* target-clock) 1.0) (update-rates! (-> *display* camera-clock) 1.0) - ((the-as (function process process) (find-parent-method fail-mission 10)) obj) + (call-parent-method obj) (none) ) diff --git a/goal_src/jak2/engine/spatial-hash/spatial-hash.gc b/goal_src/jak2/engine/spatial-hash/spatial-hash.gc index 211545ce91..7d17fc8ee7 100644 --- a/goal_src/jak2/engine/spatial-hash/spatial-hash.gc +++ b/goal_src/jak2/engine/spatial-hash/spatial-hash.gc @@ -52,7 +52,6 @@ ) ) - (defmethod verify-bits-in-bucket grid-hash ((obj grid-hash) (arg0 grid-hash-box) (arg1 grid-hash-box)) (let ((s5-0 0)) 0 @@ -121,6 +120,7 @@ (none) ) +;; WARN: Return type mismatch int vs symbol. (defun-debug validate-bucket-bits ((arg0 grid-hash) (arg1 (pointer grid-hash-word))) (let ((s3-0 (-> arg0 object-count)) (s2-0 (* (-> arg0 bucket-size) 8)) @@ -149,19 +149,12 @@ (the-as symbol 0) ) -;; definition for method 18 of type grid-hash -;; ERROR: function was not converted to expressions. Cannot decompile. (defmethod-mips2c "(method 18 grid-hash)" 18 grid-hash) -;; definition for method 19 of type grid-hash -;; ERROR: function was not converted to expressions. Cannot decompile. (defmethod-mips2c "(method 19 grid-hash)" 19 grid-hash) -;; definition for method 20 of type grid-hash -;; ERROR: function was not converted to expressions. Cannot decompile. (defmethod-mips2c "(method 20 grid-hash)" 20 grid-hash) - (defmethod set-up-box grid-hash ((obj grid-hash) (arg0 grid-hash-box) (arg1 vector) (arg2 vector)) (dotimes (v1-0 3) (set! (-> arg0 min v1-0) @@ -188,11 +181,8 @@ (none) ) -;; definition for method 22 of type grid-hash -;; ERROR: function was not converted to expressions. Cannot decompile. (defmethod-mips2c "(method 22 grid-hash)" 22 grid-hash) - (defmethod line-sphere-to-grid-box grid-hash ((obj grid-hash) (arg0 grid-hash-box) (arg1 vector) (arg2 vector) (arg3 float)) (let ((s4-0 (new 'stack-no-clear 'grid-hash-box)) (s5-0 (new 'stack-no-clear 'grid-hash-box)) @@ -378,7 +368,6 @@ (none) ) - (defmethod setup-search-box grid-hash ((obj grid-hash) (arg0 int) (arg1 vector) (arg2 vector) (arg3 vector)) (let ((v1-0 (new 'stack-no-clear 'vector)) (t1-0 (new 'stack-no-clear 'vector)) @@ -688,12 +677,8 @@ (none) ) -;; definition for method 28 of type sphere-hash -;; ERROR: function was not converted to expressions. Cannot decompile. (defmethod-mips2c "(method 28 sphere-hash)" 28 sphere-hash) - -;; definition for method 26 of type sphere-hash (defmethod add-a-sphere sphere-hash ((obj sphere-hash) (arg0 vector)) (let ((gp-0 (-> obj object-count))) (cond @@ -715,7 +700,6 @@ ) ) -;; definition for method 27 of type sphere-hash (defmethod add-a-sphere-with-flag sphere-hash ((obj sphere-hash) (arg0 vector) (arg1 int)) (let ((gp-0 (-> obj object-count))) (cond @@ -738,29 +722,19 @@ ) ) -;; definition for method 33 of type sphere-hash -;; ERROR: function was not converted to expressions. Cannot decompile. (defmethod-mips2c "(method 33 sphere-hash)" 33 sphere-hash) -;; definition for method 29 of type sphere-hash -;; ERROR: function was not converted to expressions. Cannot decompile. (defmethod-mips2c "(method 29 sphere-hash)" 29 sphere-hash) -;; definition for method 30 of type sphere-hash -;; ERROR: function was not converted to expressions. Cannot decompile. (defmethod-mips2c "(method 30 sphere-hash)" 30 sphere-hash) -;; definition for method 31 of type sphere-hash -;; ERROR: function was not converted to expressions. Cannot decompile. (defmethod-mips2c "(method 31 sphere-hash)" 31 sphere-hash) -;; definition for method 32 of type sphere-hash -;; ERROR: function was not converted to expressions. Cannot decompile. (defmethod-mips2c "(method 32 sphere-hash)" 32 sphere-hash) (defmethod dump-grid-info sphere-hash ((obj sphere-hash)) "Prints out info about the grid-hash, also draws via [[grid-hash::draw-grid]] if `debug-draw` is `#t`" - ((the (function sphere-hash none) (find-parent-method sphere-hash 15)) obj) + (call-parent-method obj) (new 'stack-no-clear 'vector) (let ((f30-0 6144.0)) (set! (-> obj work temp-box-min quad) (-> (target-pos 0) quad)) @@ -832,12 +806,8 @@ (none) ) -;; definition for method 33 of type spatial-hash -;; ERROR: function was not converted to expressions. Cannot decompile. (defmethod-mips2c "(method 33 spatial-hash)" 33 spatial-hash) - -;; definition for method 34 of type spatial-hash (defmethod add-an-object spatial-hash ((obj spatial-hash) (arg0 vector) (arg1 hash-object-info)) (let ((gp-0 (-> obj object-count))) (cond @@ -862,25 +832,14 @@ ) ) -;; definition for method 39 of type spatial-hash -;; ERROR: function was not converted to expressions. Cannot decompile. (defmethod-mips2c "(method 39 spatial-hash)" 39 spatial-hash) -;; definition for method 36 of type spatial-hash -;; ERROR: function was not converted to expressions. Cannot decompile. (defmethod-mips2c "(method 36 spatial-hash)" 36 spatial-hash) -;; definition for method 37 of type spatial-hash -;; ERROR: function was not converted to expressions. Cannot decompile. (defmethod-mips2c "(method 37 spatial-hash)" 37 spatial-hash) -;; definition for method 35 of type spatial-hash -;; ERROR: function was not converted to expressions. Cannot decompile. (defmethod-mips2c "(method 35 spatial-hash)" 35 spatial-hash) -;; definition for method 38 of type spatial-hash -;; INFO: Used lq/sq -;; WARN: Return type mismatch int vs none. (defmethod fill-actor-list-for-vec+r spatial-hash ((obj spatial-hash) (arg0 vector) (arg1 (pointer collide-shape)) (arg2 int)) (let ((v1-0 (new 'stack-no-clear 'sphere))) (set! (-> v1-0 quad) (-> arg0 quad)) @@ -889,8 +848,6 @@ ) ) -;; definition for method 40 of type spatial-hash -;; WARN: Return type mismatch int vs none. (defmethod validate-objects spatial-hash ((obj spatial-hash)) (dotimes (s5-0 (-> obj object-count)) (let ((a0-2 (-> obj object-array s5-0 object))) @@ -903,7 +860,3 @@ 0 (none) ) - - - - diff --git a/goal_src/jak2/engine/target/logic-target.gc b/goal_src/jak2/engine/target/logic-target.gc index 9b9e24d1fe..2eb3d95047 100644 --- a/goal_src/jak2/engine/target/logic-target.gc +++ b/goal_src/jak2/engine/target/logic-target.gc @@ -3301,7 +3301,7 @@ ) (set! (-> *setting-control* cam-default mode-name) #f) (set-zero! *camera-smush-control*) - ((the-as (function target none) (find-parent-method target 10)) obj) + (call-parent-method obj) (none) ) diff --git a/goal_src/jak2/engine/ui/progress/progress.gc b/goal_src/jak2/engine/ui/progress/progress.gc index 8dbcd0338e..b767f78fc8 100644 --- a/goal_src/jak2/engine/ui/progress/progress.gc +++ b/goal_src/jak2/engine/ui/progress/progress.gc @@ -54,7 +54,7 @@ (stereo-mode-backup int32 :offset-assert 216) (secrets-unlocked symbol :offset-assert 220) (missions-total-spacing float :offset-assert 224) - (clear-screen symbol :offset-assert 228) + (clear-screen symbol :offset-assert 228) ) :method-count-assert 9 :size-assert #xe8 @@ -470,7 +470,7 @@ (enable-level-text-file-loading) (persist-with-delay *setting-control* 'allow-progress (seconds 0.1) 'allow-progress #f 0.0 0) (persist-with-delay *setting-control* 'allow-pause (seconds 0.1) 'allow-pause #f 0.0 0) - ((the-as (function progress none) (find-parent-method progress 10)) obj) + (call-parent-method obj) (none) ) diff --git a/goal_src/jak2/kernel/gcommon.gc b/goal_src/jak2/kernel/gcommon.gc index 509a07b838..4fd2a7dd9e 100644 --- a/goal_src/jak2/kernel/gcommon.gc +++ b/goal_src/jak2/kernel/gcommon.gc @@ -323,6 +323,11 @@ v0-0 ) +(defmacro call-parent-method (&rest args) + `((the (current-method-function-type) (find-parent-method (current-method-type) (current-method-id))) + ,@args) + ) + (defun ref ((arg0 object) (arg1 int)) "Get the n-th item in a linked list. No range checking." (dotimes (v1-0 arg1) diff --git a/goal_src/jak2/kernel/gstate.gc b/goal_src/jak2/kernel/gstate.gc index e2a0792994..7fbe2b25c5 100644 --- a/goal_src/jak2/kernel/gstate.gc +++ b/goal_src/jak2/kernel/gstate.gc @@ -145,6 +145,10 @@ It type checks the arguments for the entry function. (set! *defstate-type-stack* '()) `(none) ) + +(seval (define *defstate-current-type* #f)) +(seval (define *defstate-current-state-name* #f)) + ;; *no-state* is just used for the compiler to know whether a handler was actually set or not (defmacro defstate (state-name parents &key (virtual #f) @@ -164,6 +168,10 @@ It type checks the arguments for the entry function. *defstate-type-stack*) ) (set! *defstate-type-stack* '()) + (when virtual + (set! *defstate-current-type* defstate-type) + (set! *defstate-current-state-name* state-name) + ) ;; check for default handlers (let ((default-handlers (assoc defstate-type *default-state-handlers*))) (when default-handlers @@ -226,6 +234,18 @@ It type checks the arguments for the entry function. ) ) +(defmacro find-parent-state () + (when (or (not *defstate-current-type*) + (not *defstate-current-state-name*)) + (error "use of find-parent-state outside of a defstate.") + ) + `(cast-to-method-type + ,*defstate-current-type* + ,*defstate-current-state-name* + (find-parent-method ,*defstate-current-type* (method-id-of-type ,*defstate-current-type* ,*defstate-current-state-name*)) + ) + ) + (defmacro behavior (bindings &rest body) "Define an anonymous behavior for a process state. This may only be used inside a defstate!" diff --git a/goal_src/jak2/levels/atoll/atoll-obs.gc b/goal_src/jak2/levels/atoll/atoll-obs.gc index 5b34b8c394..0e2912d74c 100644 --- a/goal_src/jak2/levels/atoll/atoll-obs.gc +++ b/goal_src/jak2/levels/atoll/atoll-obs.gc @@ -805,21 +805,17 @@ This commonly includes things such as: (defmethod deactivate slider ((obj slider)) (sound-stop (the-as sound-id (-> obj sound-id))) - ((the-as (function process-drawable none) (find-parent-method slider 10)) obj) + (call-parent-method obj) (none) ) -;; WARN: Return type mismatch process-drawable vs slider. (defmethod relocate slider ((obj slider) (arg0 int)) (dotimes (v1-0 4) (if (nonzero? (-> obj l-bolts v1-0)) (&+! (-> obj l-bolts v1-0) arg0) ) ) - (the-as - slider - ((the-as (function process-drawable int process-drawable) (find-parent-method slider 7)) obj arg0) - ) + (call-parent-method obj arg0) ) ;; WARN: Return type mismatch object vs none. diff --git a/goal_src/jak2/levels/atoll/juicer.gc b/goal_src/jak2/levels/atoll/juicer.gc index 1e8f0d0170..fc4b099e44 100644 --- a/goal_src/jak2/levels/atoll/juicer.gc +++ b/goal_src/jak2/levels/atoll/juicer.gc @@ -1742,7 +1742,6 @@ (none) ) -;; WARN: Return type mismatch process-focusable vs juicer. (defmethod relocate juicer ((obj juicer) (arg0 int)) (if (nonzero? (-> obj intro-path)) (&+! (-> obj intro-path) arg0) @@ -1750,10 +1749,7 @@ (if (nonzero? (-> obj joint)) (&+! (-> obj joint) arg0) ) - (the-as - juicer - ((the-as (function process-focusable int process-focusable) (find-parent-method juicer 7)) obj arg0) - ) + (call-parent-method obj arg0) ) (defmethod init-enemy! juicer ((obj juicer)) diff --git a/goal_src/jak2/levels/castle/boss/castle-baron.gc b/goal_src/jak2/levels/castle/boss/castle-baron.gc index a3ae7b7c7b..6ab665ad38 100644 --- a/goal_src/jak2/levels/castle/boss/castle-baron.gc +++ b/goal_src/jak2/levels/castle/boss/castle-baron.gc @@ -110,7 +110,7 @@ This commonly includes things such as: (defmethod deactivate cboss-elevator ((obj cboss-elevator)) (sound-stop (-> obj sound-id)) - ((the-as (function process-drawable none) (find-parent-method cboss-elevator 10)) obj) + (call-parent-method obj) (none) ) @@ -1353,7 +1353,7 @@ For example for an elevator pre-compute the distance between the first and last (defmethod init-proj-settings! krew-boss-shot ((obj krew-boss-shot)) "Init relevant settings for the [[projectile]] such as gravity, speed, timeout, etc" - ((the-as (function projectile none) (find-parent-method krew-boss-shot 31)) obj) + (call-parent-method obj) (set! (-> obj move) krew-boss-shot-move) (set! (-> obj max-speed) 245760.0) (set! (-> obj timeout) (seconds 5)) diff --git a/goal_src/jak2/levels/castle/castle-obs.gc b/goal_src/jak2/levels/castle/castle-obs.gc index 9facf7c466..48ff1c0af1 100644 --- a/goal_src/jak2/levels/castle/castle-obs.gc +++ b/goal_src/jak2/levels/castle/castle-obs.gc @@ -79,7 +79,7 @@ This commonly includes things such as: (defmethod deactivate cas-conveyor ((obj cas-conveyor)) (sound-stop (-> obj sound-id)) - ((the-as (function conveyor none) (find-parent-method cas-conveyor 10)) obj) + (call-parent-method obj) (none) ) @@ -935,7 +935,7 @@ This commonly includes things such as: (defmethod deactivate cas-elevator ((obj cas-elevator)) (sound-stop (-> obj sound-id)) - ((the-as (function elevator none) (find-parent-method cas-elevator 10)) obj) + (call-parent-method obj) (none) ) @@ -1987,7 +1987,7 @@ This commonly includes things such as: (defmethod deactivate cas-rot-blade ((obj cas-rot-blade)) (sound-stop (-> obj sound-id)) - ((the-as (function process-drawable none) (find-parent-method cas-rot-blade 10)) obj) + (call-parent-method obj) (none) ) diff --git a/goal_src/jak2/levels/castle/pad/caspad-obs.gc b/goal_src/jak2/levels/castle/pad/caspad-obs.gc index ca27fe9fd1..a7464e11d0 100644 --- a/goal_src/jak2/levels/castle/pad/caspad-obs.gc +++ b/goal_src/jak2/levels/castle/pad/caspad-obs.gc @@ -152,7 +152,7 @@ (defmethod deactivate cpad-elevator ((obj cpad-elevator)) (sound-stop (-> obj sound-id)) - ((the-as (function elevator none) (find-parent-method cpad-elevator 10)) obj) + (call-parent-method obj) (none) ) diff --git a/goal_src/jak2/levels/castle/roboguard-level.gc b/goal_src/jak2/levels/castle/roboguard-level.gc index 4ea8c01ea2..041895942f 100644 --- a/goal_src/jak2/levels/castle/roboguard-level.gc +++ b/goal_src/jak2/levels/castle/roboguard-level.gc @@ -334,9 +334,9 @@ (defstate ambush (roboguard-level) :virtual #t :enter (behavior () - (let ((t9-1 (-> (the-as state (find-parent-method roboguard-level 44)) enter))) + (let ((t9-1 (-> (find-parent-state) enter))) (if t9-1 - ((the-as (function none) t9-1)) + (t9-1) ) ) (logand! (-> self flags) -9) @@ -402,9 +402,9 @@ (defstate idle (roboguard-level) :virtual #t :enter (behavior () - (let ((t9-1 (-> (the-as state (find-parent-method roboguard-level 31)) enter))) + (let ((t9-1 (-> (find-parent-state) enter))) (if t9-1 - ((the-as (function none) t9-1)) + (t9-1) ) ) (roboguard-level-method-185 self (the-as symbol 0)) @@ -490,9 +490,9 @@ (defstate stare (roboguard-level) :virtual #t :enter (behavior () - (let ((t9-1 (-> (the-as state (find-parent-method roboguard-level 35)) enter))) + (let ((t9-1 (-> (find-parent-state) enter))) (if t9-1 - ((the-as (function none) t9-1)) + (t9-1) ) ) (roboguard-level-method-185 self (the-as symbol 0)) @@ -753,9 +753,9 @@ (defstate die (roboguard-level) :virtual #t :enter (behavior () - (let ((t9-1 (-> (the-as state (find-parent-method roboguard-level 38)) enter))) + (let ((t9-1 (-> (find-parent-state) enter))) (if t9-1 - ((the-as (function none) t9-1)) + (t9-1) ) ) (roboguard-level-method-185 self (the-as symbol 0)) @@ -1186,16 +1186,12 @@ (defmethod deactivate roboguard-level ((obj roboguard-level)) (sound-stop (-> obj roll-sound)) - ((the-as (function nav-enemy none) (find-parent-method roboguard-level 10)) obj) + (call-parent-method obj) (none) ) -;; WARN: Return type mismatch nav-enemy vs roboguard-level. (defmethod relocate roboguard-level ((obj roboguard-level) (arg0 int)) - (the-as - roboguard-level - ((the-as (function nav-enemy int nav-enemy) (find-parent-method roboguard-level 7)) obj arg0) - ) + (call-parent-method obj arg0) ) (defmethod init-enemy-collision! roboguard-level ((obj roboguard-level)) diff --git a/goal_src/jak2/levels/city/bombbot/bombbot.gc b/goal_src/jak2/levels/city/bombbot/bombbot.gc index 97c72f163f..f1cce97600 100644 --- a/goal_src/jak2/levels/city/bombbot/bombbot.gc +++ b/goal_src/jak2/levels/city/bombbot/bombbot.gc @@ -2163,7 +2163,6 @@ ) ) -;; WARN: Return type mismatch nav-enemy vs bombbot. (defmethod relocate bombbot ((obj bombbot) (arg0 int)) (dotimes (v1-0 4) (if (nonzero? (-> obj joint-ik v1-0)) @@ -2173,7 +2172,7 @@ (if (nonzero? (-> obj rigidbody)) (&+! (-> obj rigidbody) arg0) ) - (the-as bombbot ((the-as (function nav-enemy int nav-enemy) (find-parent-method bombbot 7)) obj arg0)) + (call-parent-method obj arg0) ) (defmethod init-enemy-collision! bombbot ((obj bombbot)) diff --git a/goal_src/jak2/levels/city/ctywide-obs.gc b/goal_src/jak2/levels/city/ctywide-obs.gc index e13eec62bc..1747812550 100644 --- a/goal_src/jak2/levels/city/ctywide-obs.gc +++ b/goal_src/jak2/levels/city/ctywide-obs.gc @@ -2019,7 +2019,6 @@ This commonly includes things such as: ) ) -;; WARN: Return type mismatch process-focusable vs cty-guard-turret. (defmethod relocate cty-guard-turret ((obj cty-guard-turret) (arg0 int)) (if (nonzero? (-> obj jm-turret)) (&+! (-> obj jm-turret) arg0) @@ -2030,10 +2029,7 @@ This commonly includes things such as: (if (nonzero? (-> obj jm-gunsR)) (&+! (-> obj jm-gunsR) arg0) ) - (the-as - cty-guard-turret - ((the-as (function process-focusable int process-focusable) (find-parent-method cty-guard-turret 7)) obj arg0) - ) + (call-parent-method obj arg0) ) (defmethod cty-guard-turret-method-32 cty-guard-turret ((obj cty-guard-turret)) @@ -3924,7 +3920,6 @@ This commonly includes things such as: (none) ) -;; WARN: Return type mismatch process-drawable vs barons-ship-lores. (defmethod relocate barons-ship-lores ((obj barons-ship-lores) (arg0 int)) (if (nonzero? (-> obj paths 0)) (&+! (-> obj paths 0) arg0) @@ -3935,10 +3930,7 @@ This commonly includes things such as: (if (nonzero? (-> obj paths 2)) (&+! (-> obj paths 2) arg0) ) - (the-as - barons-ship-lores - ((the-as (function process-drawable int process-drawable) (find-parent-method barons-ship-lores 7)) obj arg0) - ) + (call-parent-method obj arg0) ) (defstate idle (barons-ship-lores) diff --git a/goal_src/jak2/levels/city/traffic/citizen/guard.gc b/goal_src/jak2/levels/city/traffic/citizen/guard.gc index 7aa9f2432b..7c5d5df373 100644 --- a/goal_src/jak2/levels/city/traffic/citizen/guard.gc +++ b/goal_src/jak2/levels/city/traffic/citizen/guard.gc @@ -3701,7 +3701,6 @@ (none) ) -;; WARN: Return type mismatch process-drawable vs crimson-guard. (defmethod relocate crimson-guard ((obj crimson-guard) (arg0 int)) (if (nonzero? (-> obj joint)) (&+! (-> obj joint) arg0) @@ -3709,10 +3708,7 @@ (if (nonzero? (-> obj l-control)) (&+! (-> obj l-control) arg0) ) - (the-as - crimson-guard - ((the-as (function process-drawable int process-drawable) (find-parent-method crimson-guard 7)) obj arg0) - ) + (call-parent-method obj arg0) ) (defmethod init-enemy! crimson-guard ((obj crimson-guard)) diff --git a/goal_src/jak2/levels/city/traffic/citizen/metalhead-predator.gc b/goal_src/jak2/levels/city/traffic/citizen/metalhead-predator.gc index 1a53f0ce96..58d2033b50 100644 --- a/goal_src/jak2/levels/city/traffic/citizen/metalhead-predator.gc +++ b/goal_src/jak2/levels/city/traffic/citizen/metalhead-predator.gc @@ -1096,12 +1096,8 @@ (none) ) -;; WARN: Return type mismatch process-drawable vs metalhead-predator. (defmethod relocate metalhead-predator ((obj metalhead-predator) (arg0 int)) - (the-as - metalhead-predator - ((the-as (function process-drawable int process-drawable) (find-parent-method metalhead-predator 7)) obj arg0) - ) + (call-parent-method obj arg0) ) (defmethod init-enemy! metalhead-predator ((obj metalhead-predator)) diff --git a/goal_src/jak2/levels/city/traffic/vehicle/bike.gc b/goal_src/jak2/levels/city/traffic/vehicle/bike.gc index d0f9db04d4..7e32d5ffbd 100644 --- a/goal_src/jak2/levels/city/traffic/vehicle/bike.gc +++ b/goal_src/jak2/levels/city/traffic/vehicle/bike.gc @@ -920,7 +920,7 @@ (defmethod do-engine-sounds bike-base ((obj bike-base)) - ((the-as (function object none) (find-parent-method bike-base 36)) obj) + (call-parent-method obj) (when (logtest? (-> obj flags) (rigid-body-object-flag player-driving)) (if (zero? (-> obj roll-sound-id)) (set! (-> obj roll-sound-id) (new-sound-id)) @@ -952,7 +952,7 @@ ) (defmethod draw-thrusters bike-base ((obj bike-base)) - ((the-as (function object none) (find-parent-method bike-base 85)) obj) + (call-parent-method obj) (when (logtest? (-> obj rbody state flags) (rigid-body-flag enable-physics)) (let ((s5-0 (new 'stack-no-clear 'inline-array 'matrix 3))) (let* ((v1-4 (the-as object (-> s5-0 0 vector 2))) @@ -1047,7 +1047,7 @@ (if (nonzero? (-> obj brake-r)) (&+! (-> obj brake-r) arg0) ) - ((the-as (function object int bikea) (find-parent-method bikea 7)) obj arg0) + (call-parent-method obj arg0) ) (defmethod allocate-and-init-cshape bikea ((obj bikea)) @@ -1181,7 +1181,7 @@ (if (nonzero? (-> obj flap-r)) (&+! (-> obj flap-r) arg0) ) - ((the-as (function object int bikeb) (find-parent-method bikeb 7)) obj arg0) + (call-parent-method obj arg0) ) (defmethod allocate-and-init-cshape bikeb ((obj bikeb)) @@ -1329,7 +1329,7 @@ (if (nonzero? (-> obj spoiler-r)) (&+! (-> obj spoiler-r) arg0) ) - ((the-as (function object int bikec) (find-parent-method bikec 7)) obj arg0) + (call-parent-method obj arg0) ) (defmethod allocate-and-init-cshape bikec ((obj bikec)) @@ -1464,7 +1464,7 @@ (if (nonzero? (-> obj turret-jm)) (&+! (-> obj turret-jm) arg0) ) - ((the-as (function object int guard-bike) (find-parent-method guard-bike 7)) obj arg0) + (call-parent-method obj arg0) ) (defmethod start-jump guard-bike ((obj guard-bike)) diff --git a/goal_src/jak2/levels/city/traffic/vehicle/car.gc b/goal_src/jak2/levels/city/traffic/vehicle/car.gc index a8998a1663..ebe615685c 100644 --- a/goal_src/jak2/levels/city/traffic/vehicle/car.gc +++ b/goal_src/jak2/levels/city/traffic/vehicle/car.gc @@ -1170,7 +1170,7 @@ (if (nonzero? (-> obj rudder-r)) (&+! (-> obj rudder-r) arg0) ) - ((the-as (function object object cara) (find-parent-method cara 7)) obj arg0) + (call-parent-method obj arg0) ) (defmethod allocate-and-init-cshape cara ((obj cara)) @@ -1310,7 +1310,7 @@ (if (nonzero? (-> obj fin-rr)) (&+! (-> obj fin-rr) arg0) ) - ((the-as (function object object carb) (find-parent-method carb 7)) obj arg0) + (call-parent-method obj arg0) ) (defmethod allocate-and-init-cshape carb ((obj carb)) @@ -1427,7 +1427,6 @@ ) -;; WARN: Return type mismatch carb vs carc. (defmethod relocate carc ((obj carc) (arg0 int)) (if (nonzero? (-> obj steering-wheel)) (&+! (-> obj steering-wheel) arg0) @@ -1450,7 +1449,7 @@ (if (nonzero? (-> obj fin2-rr)) (&+! (-> obj fin2-rr) arg0) ) - (the-as carc ((the-as (function object object carb) (find-parent-method carc 7)) obj arg0)) + (call-parent-method obj arg0) ) (defmethod allocate-and-init-cshape carc ((obj carc)) @@ -1583,7 +1582,7 @@ (if (nonzero? (-> obj turret-jm)) (&+! (-> obj turret-jm) arg0) ) - ((the-as (function object object hellcat) (find-parent-method hellcat 7)) obj arg0) + (call-parent-method obj arg0) ) (defmethod allocate-and-init-cshape hellcat ((obj hellcat)) diff --git a/goal_src/jak2/levels/city/traffic/vehicle/transport.gc b/goal_src/jak2/levels/city/traffic/vehicle/transport.gc index 2c11654b81..0e241dfe19 100644 --- a/goal_src/jak2/levels/city/traffic/vehicle/transport.gc +++ b/goal_src/jak2/levels/city/traffic/vehicle/transport.gc @@ -117,15 +117,11 @@ (none) ) -;; WARN: Return type mismatch process-drawable vs vehicle-turret. (defmethod relocate vehicle-turret ((obj vehicle-turret) (arg0 int)) (if (nonzero? (-> obj turret-jm)) (&+! (-> obj turret-jm) arg0) ) - (the-as - vehicle-turret - ((the-as (function process-drawable int process-drawable) (find-parent-method vehicle-turret 7)) obj arg0) - ) + (call-parent-method obj arg0) ) (defmethod vehicle-turret-method-30 vehicle-turret ((obj vehicle-turret)) @@ -271,7 +267,7 @@ (defmethod deactivate transport ((obj transport)) (sound-stop (-> obj ambient-sound-id)) - ((the-as (function process-drawable none) (find-parent-method transport 10)) obj) + (call-parent-method obj) (none) ) diff --git a/goal_src/jak2/levels/city/traffic/vehicle/vehicle-rider.gc b/goal_src/jak2/levels/city/traffic/vehicle/vehicle-rider.gc index 673e551cd4..f37bad7a00 100644 --- a/goal_src/jak2/levels/city/traffic/vehicle/vehicle-rider.gc +++ b/goal_src/jak2/levels/city/traffic/vehicle/vehicle-rider.gc @@ -295,7 +295,7 @@ This commonly includes things such as: ) (defmethod vehicle-rider-method-33 citizen-norm-rider ((obj citizen-norm-rider)) - ((the-as (function vehicle-rider none) (find-parent-method citizen-norm-rider 33)) obj) + (call-parent-method obj) (setup-masks (-> obj draw) 0 -1) (setup-masks (-> obj draw) 32 0) (cond @@ -394,7 +394,7 @@ This commonly includes things such as: ) (defmethod vehicle-rider-method-33 crimson-guard-rider ((obj crimson-guard-rider)) - ((the-as (function vehicle-rider none) (find-parent-method crimson-guard-rider 33)) obj) + (call-parent-method obj) (setup-masks (-> obj draw) 0 28) (setup-masks (-> obj draw) 3 0) (if (logtest? (-> obj flags) 4) diff --git a/goal_src/jak2/levels/city/traffic/vehicle/vehicle-util.gc b/goal_src/jak2/levels/city/traffic/vehicle/vehicle-util.gc index 8526724fab..0cac38956e 100644 --- a/goal_src/jak2/levels/city/traffic/vehicle/vehicle-util.gc +++ b/goal_src/jak2/levels/city/traffic/vehicle/vehicle-util.gc @@ -152,7 +152,7 @@ (defmethod deactivate vehicle ((obj vehicle)) (vehicle-method-110 obj) - ((the-as (function rigid-body-object none) (find-parent-method vehicle 10)) obj) + (call-parent-method obj) (none) ) diff --git a/goal_src/jak2/levels/common/ai/ashelin/ash-shot.gc b/goal_src/jak2/levels/common/ai/ashelin/ash-shot.gc index 5f8d9a5845..dc11fcda12 100644 --- a/goal_src/jak2/levels/common/ai/ashelin/ash-shot.gc +++ b/goal_src/jak2/levels/common/ai/ashelin/ash-shot.gc @@ -358,6 +358,7 @@ (none) ) +;; WARN: Return type mismatch object vs none. (defmethod play-impact-sound ashelin-shot ((obj ashelin-shot) (arg0 projectile-options)) (let ((v1-0 arg0)) (cond @@ -368,7 +369,7 @@ (sound-play "ashelin-shot-hi") ) ((= v1-0 (projectile-options lose-altitude proj-options-2)) - ((the-as (function projectile projectile-options none) (find-parent-method ashelin-shot 28)) obj arg0) + (call-parent-method obj arg0) ) ) ) diff --git a/goal_src/jak2/levels/common/battle.gc b/goal_src/jak2/levels/common/battle.gc index bfa4284010..4cae58ed09 100644 --- a/goal_src/jak2/levels/common/battle.gc +++ b/goal_src/jak2/levels/common/battle.gc @@ -1594,14 +1594,10 @@ obj ) -;; WARN: Return type mismatch process-drawable vs battle. (defmethod relocate battle ((obj battle) (arg0 int)) (&+! (-> obj spawners) arg0) (&+! (-> obj allies) arg0) - (the-as - battle - ((the-as (function process-drawable int process-drawable) (find-parent-method battle 7)) obj arg0) - ) + (call-parent-method obj arg0) ) (defmethod initialize-spawner-breeds battle ((obj battle) (arg0 battle-spawner) (arg1 entity-actor)) diff --git a/goal_src/jak2/levels/common/elec-gate.gc b/goal_src/jak2/levels/common/elec-gate.gc index 16571a43ba..d38a23b24f 100644 --- a/goal_src/jak2/levels/common/elec-gate.gc +++ b/goal_src/jak2/levels/common/elec-gate.gc @@ -762,7 +762,7 @@ (defmethod deactivate elec-gate ((obj elec-gate)) (set-elec-scale-if-close! obj 0.0) - ((the-as (function process-drawable none) (find-parent-method elec-gate 10)) obj) + (call-parent-method obj) (none) ) diff --git a/goal_src/jak2/levels/common/enemy/centurion.gc b/goal_src/jak2/levels/common/enemy/centurion.gc index dc91d429b3..30229ea56f 100644 --- a/goal_src/jak2/levels/common/enemy/centurion.gc +++ b/goal_src/jak2/levels/common/enemy/centurion.gc @@ -160,7 +160,7 @@ (sound-play "cent-shot-hit") ) ((= v1-0 (projectile-options lose-altitude proj-options-2)) - ((the-as (function projectile projectile-options sound-id) (find-parent-method centurion-shot 28)) obj arg0) + (call-parent-method obj arg0) ) ) ) @@ -170,7 +170,7 @@ (defmethod init-proj-settings! centurion-shot ((obj centurion-shot)) "Init relevant settings for the [[projectile]] such as gravity, speed, timeout, etc" - ((the-as (function projectile none) (find-parent-method centurion-shot 31)) obj) + (call-parent-method obj) (set! (-> obj max-speed) 327680.0) (set! (-> obj timeout) (seconds 1.25)) (none) @@ -887,7 +887,7 @@ (defmethod dispose! centurion ((obj centurion)) "Cleans-up the enemy and any associated resources. Potentially spawns skull gems" (play-communicator-speech! (-> *talker-speech* 58)) - ((the-as (function enemy none) (find-parent-method centurion 132)) obj) + (call-parent-method obj) (none) ) @@ -1486,15 +1486,11 @@ (none) ) -;; WARN: Return type mismatch process-focusable vs centurion. (defmethod relocate centurion ((obj centurion) (arg0 int)) (if (nonzero? (-> obj joint)) (&+! (-> obj joint) arg0) ) - (the-as - centurion - ((the-as (function process-focusable int process-focusable) (find-parent-method centurion 7)) obj arg0) - ) + (call-parent-method obj arg0) ) (defmethod init-enemy! centurion ((obj centurion)) diff --git a/goal_src/jak2/levels/common/enemy/flitter.gc b/goal_src/jak2/levels/common/enemy/flitter.gc index 66d2dee9be..0c361f9d6e 100644 --- a/goal_src/jak2/levels/common/enemy/flitter.gc +++ b/goal_src/jak2/levels/common/enemy/flitter.gc @@ -1250,7 +1250,7 @@ (logior! (-> obj minimap flags) (minimap-flag fade-out)) (set! (-> obj minimap) #f) ) - ((the-as (function nav-enemy none) (find-parent-method flitter 132)) obj) + (call-parent-method obj) (none) ) diff --git a/goal_src/jak2/levels/common/enemy/fodder/fodder.gc b/goal_src/jak2/levels/common/enemy/fodder/fodder.gc index 62d9fc4b1c..13f95963f2 100644 --- a/goal_src/jak2/levels/common/enemy/fodder/fodder.gc +++ b/goal_src/jak2/levels/common/enemy/fodder/fodder.gc @@ -1033,7 +1033,6 @@ (none) ) -;; WARN: Return type mismatch nav-enemy vs fodder. (defmethod relocate fodder ((obj fodder) (arg0 int)) (if (nonzero? (-> obj left-eye)) (&+! (-> obj left-eye) arg0) @@ -1041,7 +1040,7 @@ (if (nonzero? (-> obj right-eye)) (&+! (-> obj right-eye) arg0) ) - (the-as fodder ((the-as (function nav-enemy int nav-enemy) (find-parent-method fodder 7)) obj arg0)) + (call-parent-method obj arg0) ) (defun fodder-setup-eye-control ((arg0 joint-mod)) diff --git a/goal_src/jak2/levels/common/enemy/grenadier.gc b/goal_src/jak2/levels/common/enemy/grenadier.gc index fbe87524b8..4655fff45f 100644 --- a/goal_src/jak2/levels/common/enemy/grenadier.gc +++ b/goal_src/jak2/levels/common/enemy/grenadier.gc @@ -1245,7 +1245,6 @@ (none) ) -;; WARN: Return type mismatch process-focusable vs grenadier. (defmethod relocate grenadier ((obj grenadier) (arg0 int)) (if (nonzero? (-> obj joint)) (&+! (-> obj joint) arg0) @@ -1255,10 +1254,7 @@ (&+! (-> obj hostile-path) arg0) ) ) - (the-as - grenadier - ((the-as (function process-focusable int process-focusable) (find-parent-method grenadier 7)) obj arg0) - ) + (call-parent-method obj arg0) ) (defmethod init-enemy! grenadier ((obj grenadier)) diff --git a/goal_src/jak2/levels/common/enemy/grunt.gc b/goal_src/jak2/levels/common/enemy/grunt.gc index a5b1a80263..951596bd97 100644 --- a/goal_src/jak2/levels/common/enemy/grunt.gc +++ b/goal_src/jak2/levels/common/enemy/grunt.gc @@ -1409,7 +1409,7 @@ (logior! (-> obj minimap flags) (minimap-flag fade-out)) (set! (-> obj minimap) #f) ) - ((the-as (function nav-enemy none) (find-parent-method grunt 132)) obj) + (call-parent-method obj) (none) ) diff --git a/goal_src/jak2/levels/common/enemy/guards/crimson-guard-level.gc b/goal_src/jak2/levels/common/enemy/guards/crimson-guard-level.gc index 78773382fd..b22f7c28f7 100644 --- a/goal_src/jak2/levels/common/enemy/guards/crimson-guard-level.gc +++ b/goal_src/jak2/levels/common/enemy/guards/crimson-guard-level.gc @@ -4147,7 +4147,6 @@ (none) ) -;; WARN: Return type mismatch nav-enemy vs crimson-guard-level. (defmethod relocate crimson-guard-level ((obj crimson-guard-level) (arg0 int)) (if (nonzero? (-> obj joint)) (&+! (-> obj joint) arg0) @@ -4155,10 +4154,7 @@ (if (nonzero? (-> obj l-control)) (&+! (-> obj l-control) arg0) ) - (the-as - crimson-guard-level - ((the-as (function nav-enemy int nav-enemy) (find-parent-method crimson-guard-level 7)) obj arg0) - ) + (call-parent-method obj arg0) ) ;; WARN: Return type mismatch float vs none. diff --git a/goal_src/jak2/levels/common/enemy/hopper.gc b/goal_src/jak2/levels/common/enemy/hopper.gc index b778f701e5..dc20e5976e 100644 --- a/goal_src/jak2/levels/common/enemy/hopper.gc +++ b/goal_src/jak2/levels/common/enemy/hopper.gc @@ -913,19 +913,15 @@ (logior! (-> obj minimap flags) (minimap-flag fade-out)) (set! (-> obj minimap) #f) ) - ((the-as (function enemy none) (find-parent-method hopper 132)) obj) + (call-parent-method obj) (none) ) -;; WARN: Return type mismatch process-focusable vs hopper. (defmethod relocate hopper ((obj hopper) (arg0 int)) (if (nonzero? (-> obj path-intro)) (&+! (-> obj path-intro) arg0) ) - (the-as - hopper - ((the-as (function process-focusable int process-focusable) (find-parent-method hopper 7)) obj arg0) - ) + (call-parent-method obj arg0) ) (defmethod init-enemy-collision! hopper ((obj hopper)) diff --git a/goal_src/jak2/levels/common/enemy/hover/crimson-guard-hover.gc b/goal_src/jak2/levels/common/enemy/hover/crimson-guard-hover.gc index 98cd894c2f..caefaca469 100644 --- a/goal_src/jak2/levels/common/enemy/hover/crimson-guard-hover.gc +++ b/goal_src/jak2/levels/common/enemy/hover/crimson-guard-hover.gc @@ -593,7 +593,7 @@ (defmethod enemy-method-135 crimson-guard-hover ((obj crimson-guard-hover) (arg0 int)) (if (and (zero? arg0) (logtest? #x4000000 (-> obj incoming penetrate-using))) (sound-play "hover-take-hit") - ((the-as (function enemy int sound-id) (find-parent-method crimson-guard-hover 135)) obj arg0) + (call-parent-method obj arg0) ) (the-as sound-id 0) ) @@ -913,7 +913,7 @@ (defstate knocked (crimson-guard-hover) :virtual #t :enter (behavior () - (let ((t9-1 (-> (the-as (state hover-enemy) (find-parent-method crimson-guard-hover 30)) enter))) + (let ((t9-1 (-> (find-parent-state) enter))) (if t9-1 (t9-1) ) @@ -987,7 +987,7 @@ (defstate flying-death (crimson-guard-hover) :virtual #t :enter (behavior () - (let ((t9-1 (-> (the-as (state hover-enemy) (find-parent-method crimson-guard-hover 138)) enter))) + (let ((t9-1 (-> (find-parent-state) enter))) (if t9-1 (t9-1) ) @@ -1048,7 +1048,7 @@ (defstate flying-death-explode (crimson-guard-hover) :virtual #t :enter (behavior () - (let ((t9-1 (-> (the-as (state hover-enemy) (find-parent-method crimson-guard-hover 139)) enter))) + (let ((t9-1 (-> (find-parent-state) enter))) (if t9-1 (t9-1) ) @@ -1144,16 +1144,7 @@ ) ) ) - ((the-as - (function enemy process int symbol event-message-block object) - (find-parent-method crimson-guard-hover 74) - ) - obj - arg0 - arg1 - arg2 - arg3 - ) + (call-parent-method obj arg0 arg1 arg2 arg3) ) (('notify) (let ((a0-27 (the-as object (-> arg3 param 0))) @@ -1173,28 +1164,10 @@ ) ) ) - ((the-as - (function enemy process int symbol event-message-block object) - (find-parent-method crimson-guard-hover 74) - ) - obj - arg0 - arg1 - arg2 - arg3 - ) + (call-parent-method obj arg0 arg1 arg2 arg3) ) (else - ((the-as - (function enemy process int symbol event-message-block object) - (find-parent-method crimson-guard-hover 74) - ) - obj - arg0 - arg1 - arg2 - arg3 - ) + (call-parent-method obj arg0 arg1 arg2 arg3) ) ) ) @@ -1288,7 +1261,7 @@ ) ) (else - ((the-as (function hover-enemy vector none) (find-parent-method crimson-guard-hover 52)) obj arg0) + (call-parent-method obj arg0) ) ) ) diff --git a/goal_src/jak2/levels/common/enemy/hover/flamer.gc b/goal_src/jak2/levels/common/enemy/hover/flamer.gc index 1a998610b5..7a793d5cac 100644 --- a/goal_src/jak2/levels/common/enemy/hover/flamer.gc +++ b/goal_src/jak2/levels/common/enemy/hover/flamer.gc @@ -1395,15 +1395,11 @@ (none) ) -;; WARN: Return type mismatch process-drawable vs flamer. (defmethod relocate flamer ((obj flamer) (arg0 int)) (if (nonzero? (-> obj flit-joint)) (&+! (-> obj flit-joint) arg0) ) - (the-as - flamer - ((the-as (function process-drawable int process-drawable) (find-parent-method flamer 7)) obj arg0) - ) + (call-parent-method obj arg0) ) (defmethod init-enemy! flamer ((obj flamer)) diff --git a/goal_src/jak2/levels/common/enemy/hover/hover-enemy-battle.gc b/goal_src/jak2/levels/common/enemy/hover/hover-enemy-battle.gc index 198f1740bc..8a5d09e70a 100644 --- a/goal_src/jak2/levels/common/enemy/hover/hover-enemy-battle.gc +++ b/goal_src/jak2/levels/common/enemy/hover/hover-enemy-battle.gc @@ -247,7 +247,6 @@ (none) ) -;; WARN: Return type mismatch process vs hover-enemy-manager. (defmethod relocate hover-enemy-manager ((obj hover-enemy-manager) (arg0 int)) (when (-> obj formation) (if (nonzero? (-> obj formation)) @@ -257,10 +256,7 @@ (if (nonzero? (-> obj path)) (&+! (-> obj path) arg0) ) - (the-as - hover-enemy-manager - ((the-as (function process int process) (find-parent-method hover-enemy-manager 7)) obj arg0) - ) + (call-parent-method obj arg0) ) (defmethod hover-enemy-manager-init! hover-enemy-manager ((obj hover-enemy-manager) (arg0 (array hover-enemy-battle-command))) diff --git a/goal_src/jak2/levels/common/enemy/hover/hover-enemy.gc b/goal_src/jak2/levels/common/enemy/hover/hover-enemy.gc index 57390882c3..69354e7dd6 100644 --- a/goal_src/jak2/levels/common/enemy/hover/hover-enemy.gc +++ b/goal_src/jak2/levels/common/enemy/hover/hover-enemy.gc @@ -605,7 +605,7 @@ (set! (-> self knocked-start-level) (-> self root trans y)) ) :exit (behavior () - (let ((t9-1 (-> (the-as state (find-parent-method hover-enemy 30)) exit))) + (let ((t9-1 (-> (the-as state (find-parent-state)) exit))) (if t9-1 (t9-1) ) diff --git a/goal_src/jak2/levels/common/enemy/hover/hover-formation.gc b/goal_src/jak2/levels/common/enemy/hover/hover-formation.gc index 7f42b297c9..8c2bd8ce2b 100644 --- a/goal_src/jak2/levels/common/enemy/hover/hover-formation.gc +++ b/goal_src/jak2/levels/common/enemy/hover/hover-formation.gc @@ -648,7 +648,6 @@ ) ) -;; WARN: Return type mismatch basic vs hover-formation. (defmethod relocate hover-formation ((obj hover-formation) (arg0 int)) (if (nonzero? (-> obj formation)) (&+! (-> obj formation) arg0) @@ -656,7 +655,7 @@ (if (nonzero? (-> obj path)) (&+! (-> obj path) arg0) ) - (the-as hover-formation ((the-as (function basic int basic) (find-parent-method hover-formation 7)) obj arg0)) + (call-parent-method obj arg0) ) (defmethod hover-formation-method-15 hover-formation ((obj hover-formation) (arg0 vector) (arg1 vector)) diff --git a/goal_src/jak2/levels/common/enemy/hover/wasp.gc b/goal_src/jak2/levels/common/enemy/hover/wasp.gc index ebc9482a92..cf0f1a762d 100644 --- a/goal_src/jak2/levels/common/enemy/hover/wasp.gc +++ b/goal_src/jak2/levels/common/enemy/hover/wasp.gc @@ -500,7 +500,7 @@ ) ) (else - ((the-as (function enemy vector none) (find-parent-method wasp 52)) obj arg0) + (call-parent-method obj arg0) ) ) ) diff --git a/goal_src/jak2/levels/common/enemy/metalmonk.gc b/goal_src/jak2/levels/common/enemy/metalmonk.gc index 9174fe1a6a..38de955695 100644 --- a/goal_src/jak2/levels/common/enemy/metalmonk.gc +++ b/goal_src/jak2/levels/common/enemy/metalmonk.gc @@ -1148,15 +1148,11 @@ #f ) -;; WARN: Return type mismatch process-focusable vs metalmonk. (defmethod relocate metalmonk ((obj metalmonk) (arg0 int)) (if (nonzero? (-> obj intro-path)) (&+! (-> obj intro-path) arg0) ) - (the-as - metalmonk - ((the-as (function process-focusable int process-focusable) (find-parent-method metalmonk 7)) obj arg0) - ) + (call-parent-method obj arg0) ) (defmethod init-enemy! metalmonk ((obj metalmonk)) diff --git a/goal_src/jak2/levels/common/enemy/spyder.gc b/goal_src/jak2/levels/common/enemy/spyder.gc index 2999b70d21..b82a2c9461 100644 --- a/goal_src/jak2/levels/common/enemy/spyder.gc +++ b/goal_src/jak2/levels/common/enemy/spyder.gc @@ -45,7 +45,7 @@ (defmethod init-proj-settings! spyder-shot ((obj spyder-shot)) "Init relevant settings for the [[projectile]] such as gravity, speed, timeout, etc" - ((the-as (function projectile none) (find-parent-method spyder-shot 31)) obj) + (call-parent-method obj) (set! (-> obj max-speed) 307200.0) (set! (-> obj timeout) (seconds 0.267)) (none) @@ -1304,7 +1304,6 @@ (none) ) -;; WARN: Return type mismatch process-focusable vs spyder. (defmethod relocate spyder ((obj spyder) (arg0 int)) (if (nonzero? (-> obj joint)) (&+! (-> obj joint) arg0) @@ -1314,10 +1313,7 @@ (&+! (-> obj joint-ik v1-4) arg0) ) ) - (the-as - spyder - ((the-as (function process-focusable int process-focusable) (find-parent-method spyder 7)) obj arg0) - ) + (call-parent-method obj arg0) ) (defmethod init-enemy! spyder ((obj spyder)) diff --git a/goal_src/jak2/levels/common/entities/com-elevator.gc b/goal_src/jak2/levels/common/entities/com-elevator.gc index 2c91f1c113..d8960f29e7 100644 --- a/goal_src/jak2/levels/common/entities/com-elevator.gc +++ b/goal_src/jak2/levels/common/entities/com-elevator.gc @@ -97,9 +97,9 @@ (defstate dormant (com-elevator) :virtual #t :enter (behavior () - (let ((t9-1 (-> (the-as state (find-parent-method com-elevator 34)) enter))) + (let ((t9-1 (-> (find-parent-state) enter))) (if t9-1 - ((the-as (function none) t9-1)) + (t9-1) ) ) (process-entity-status! self (entity-perm-status subtask-complete) #t) @@ -179,7 +179,7 @@ (defmethod deactivate com-elevator ((obj com-elevator)) (sound-stop (-> obj sound-id)) - ((the-as (function elevator none) (find-parent-method com-elevator 10)) obj) + (call-parent-method obj) (none) ) @@ -312,7 +312,7 @@ For example for an elevator pre-compute the distance between the first and last (defmethod deactivate tomb-trans-elevator ((obj tomb-trans-elevator)) (sound-stop (-> obj sound-id)) - ((the-as (function com-elevator none) (find-parent-method tomb-trans-elevator 10)) obj) + (call-parent-method obj) (none) ) @@ -320,7 +320,7 @@ For example for an elevator pre-compute the distance between the first and last (defmethod init-plat! tomb-trans-elevator ((obj tomb-trans-elevator)) "Does any necessary initial platform setup. For example for an elevator pre-compute the distance between the first and last points (both ways) and clear the sound." - ((the-as (function com-elevator none) (find-parent-method tomb-trans-elevator 33)) obj) + (call-parent-method obj) (set! (-> obj sound-id) (new-sound-id)) (none) ) diff --git a/goal_src/jak2/levels/common/entities/spydroid.gc b/goal_src/jak2/levels/common/entities/spydroid.gc index 3cbea7f59a..de0d303cab 100644 --- a/goal_src/jak2/levels/common/entities/spydroid.gc +++ b/goal_src/jak2/levels/common/entities/spydroid.gc @@ -1304,7 +1304,7 @@ (if (nonzero? (-> obj explode-part)) (kill-and-free-particles (-> obj explode-part)) ) - ((the-as (function process-focusable none) (find-parent-method spydroid 10)) obj) + (call-parent-method obj) (none) ) diff --git a/goal_src/jak2/levels/common/race/race-manager.gc b/goal_src/jak2/levels/common/race/race-manager.gc index a006974419..24d5a9db5d 100644 --- a/goal_src/jak2/levels/common/race/race-manager.gc +++ b/goal_src/jak2/levels/common/race/race-manager.gc @@ -1566,7 +1566,7 @@ (defmethod deactivate race-manager ((obj race-manager)) (persist-with-delay *setting-control* 'music-volume (seconds 3) 'music-volume 'abs 0.0 0) (send-event *traffic-manager* 'restore-default-settings) - ((the-as (function process none) (find-parent-method race-manager 10)) obj) + (call-parent-method obj) (none) ) diff --git a/goal_src/jak2/levels/common/scene-actor.gc b/goal_src/jak2/levels/common/scene-actor.gc index 781bd1fc6a..66088c2f3e 100644 --- a/goal_src/jak2/levels/common/scene-actor.gc +++ b/goal_src/jak2/levels/common/scene-actor.gc @@ -688,7 +688,7 @@ This commonly includes things such as: ) ) ) - ((the-as (function process-taskable none) (find-parent-method youngsamos-npc 32)) obj) + (call-parent-method obj) (none) ) diff --git a/goal_src/jak2/levels/dig/dig-obs.gc b/goal_src/jak2/levels/dig/dig-obs.gc index d1c7c5d48e..a81ec5c289 100644 --- a/goal_src/jak2/levels/dig/dig-obs.gc +++ b/goal_src/jak2/levels/dig/dig-obs.gc @@ -30,7 +30,7 @@ ) (defmethod rigid-body-object-method-29 dig-sinking-plat ((obj dig-sinking-plat) (arg0 float)) - ((the-as (function rigid-body-platform float none) (find-parent-method dig-sinking-plat 29)) obj arg0) + (call-parent-method obj arg0) (rigid-body-platform-method-56 obj (-> obj anchor-point)) 0 (none) diff --git a/goal_src/jak2/levels/dig/dig3-obs.gc b/goal_src/jak2/levels/dig/dig3-obs.gc index e6f62ab525..2604db5459 100644 --- a/goal_src/jak2/levels/dig/dig3-obs.gc +++ b/goal_src/jak2/levels/dig/dig3-obs.gc @@ -1403,7 +1403,7 @@ This commonly includes things such as: ) (defmethod rigid-body-object-method-29 dig-tipping-rock ((obj dig-tipping-rock) (arg0 float)) - ((the-as (function rigid-body-platform float none) (find-parent-method dig-tipping-rock 29)) obj arg0) + (call-parent-method obj arg0) (rigid-body-platform-method-56 obj (-> obj anchor-point)) 0 (none) diff --git a/goal_src/jak2/levels/drill/drill-baron.gc b/goal_src/jak2/levels/drill/drill-baron.gc index be7b830db1..a0386e2b83 100644 --- a/goal_src/jak2/levels/drill/drill-baron.gc +++ b/goal_src/jak2/levels/drill/drill-baron.gc @@ -977,7 +977,6 @@ (none) ) -;; WARN: Return type mismatch process-drawable vs drill-barons-ship-turret. (defmethod relocate drill-barons-ship-turret ((obj drill-barons-ship-turret) (arg0 int)) (when (-> obj jmod) (if (nonzero? (-> obj jmod)) @@ -994,13 +993,7 @@ (&+! (-> obj jmod-right) arg0) ) ) - (the-as - drill-barons-ship-turret - ((the-as (function process-drawable int process-drawable) (find-parent-method drill-barons-ship-turret 7)) - obj - arg0 - ) - ) + (call-parent-method obj arg0) ) ;; WARN: Return type mismatch object vs none. @@ -1122,7 +1115,7 @@ This commonly includes things such as: (defmethod init-proj-settings! drill-ship-shot ((obj drill-ship-shot)) "Init relevant settings for the [[projectile]] such as gravity, speed, timeout, etc" - ((the-as (function guard-shot none) (find-parent-method drill-ship-shot 31)) obj) + (call-parent-method obj) (set! (-> obj attack-mode) 'drill-ship-shot) (set! (-> obj move) guard-shot-move) (set! (-> obj max-speed) 737280.0) diff --git a/goal_src/jak2/levels/drill/drill-obs.gc b/goal_src/jak2/levels/drill/drill-obs.gc index 9f285c44f7..fd3b634b10 100644 --- a/goal_src/jak2/levels/drill/drill-obs.gc +++ b/goal_src/jak2/levels/drill/drill-obs.gc @@ -460,7 +460,7 @@ This commonly includes things such as: (defmethod deactivate drill-elevator ((obj drill-elevator)) (sound-stop (-> obj sound-id)) - ((the-as (function process-drawable none) (find-parent-method drill-elevator 10)) obj) + (call-parent-method obj) (none) ) @@ -811,15 +811,11 @@ For example for an elevator pre-compute the distance between the first and last (none) ) -;; WARN: Return type mismatch process-drawable vs fire-floor. (defmethod relocate fire-floor ((obj fire-floor) (arg0 int)) (if (nonzero? (-> obj part-off)) (&+! (-> obj part-off) arg0) ) - (the-as - fire-floor - ((the-as (function process-drawable int process-drawable) (find-parent-method fire-floor 7)) obj arg0) - ) + (call-parent-method obj arg0) ) (defmethod deactivate fire-floor ((obj fire-floor)) @@ -827,7 +823,7 @@ For example for an elevator pre-compute the distance between the first and last (if (nonzero? (-> obj part-off)) (kill-and-free-particles (-> obj part-off)) ) - ((the-as (function process-drawable none) (find-parent-method fire-floor 10)) obj) + (call-parent-method obj) (none) ) diff --git a/goal_src/jak2/levels/drill/drillmid-obs.gc b/goal_src/jak2/levels/drill/drillmid-obs.gc index 1cdb824562..5307cb4ef9 100644 --- a/goal_src/jak2/levels/drill/drillmid-obs.gc +++ b/goal_src/jak2/levels/drill/drillmid-obs.gc @@ -175,7 +175,7 @@ This commonly includes things such as: :exit (behavior () (sound-stop (-> self sound-id)) (sound-play "drl-elev-stop") - (let ((t9-4 (-> (the-as state (find-parent-method drill-lift 36)) exit))) + (let ((t9-4 (-> (find-parent-state) exit))) (if t9-4 (t9-4) ) @@ -183,7 +183,7 @@ This commonly includes things such as: ) :post (behavior () (sound-play "drl-elevator-lp" :id (-> self sound-id) :position (-> self root trans)) - (let ((t9-2 (-> (the-as state (find-parent-method drill-lift 36)) post))) + (let ((t9-2 (-> (the-as state (find-parent-state)) post))) (if t9-2 ((the-as (function none) t9-2)) ) diff --git a/goal_src/jak2/levels/drill/ginsu.gc b/goal_src/jak2/levels/drill/ginsu.gc index 1bb4f4f150..293eb4b857 100644 --- a/goal_src/jak2/levels/drill/ginsu.gc +++ b/goal_src/jak2/levels/drill/ginsu.gc @@ -910,11 +910,9 @@ ) (defmethod deactivate ginsu ((obj ginsu)) - (when (nonzero? (-> obj blade-part)) - (let ((a0-1 (-> obj blade-part))) - ((the-as (function sparticle-launch-control none) (method-of-object a0-1 kill-and-free-particles)) a0-1) + (if (nonzero? (-> obj blade-part)) + (kill-and-free-particles (-> obj blade-part)) ) - ) (if (-> obj blade-sound-playing) (sound-stop (-> obj blade-sound)) ) diff --git a/goal_src/jak2/levels/forest/forest-obs.gc b/goal_src/jak2/levels/forest/forest-obs.gc index 79c290ce1f..69368966ae 100644 --- a/goal_src/jak2/levels/forest/forest-obs.gc +++ b/goal_src/jak2/levels/forest/forest-obs.gc @@ -395,7 +395,7 @@ This commonly includes things such as: (send-event (handle->process (-> obj hud)) 'hide-and-die) ) (sound-stop (-> obj sound-id)) - ((the-as (function process-focusable none) (find-parent-method forest-youngsamos 10)) obj) + (call-parent-method obj) (none) ) diff --git a/goal_src/jak2/levels/forest/predator.gc b/goal_src/jak2/levels/forest/predator.gc index 04ddceab38..3b17fc0291 100644 --- a/goal_src/jak2/levels/forest/predator.gc +++ b/goal_src/jak2/levels/forest/predator.gc @@ -1422,12 +1422,8 @@ (none) ) -;; WARN: Return type mismatch process-focusable vs predator. (defmethod relocate predator ((obj predator) (arg0 int)) - (the-as - predator - ((the-as (function process-focusable int process-focusable) (find-parent-method predator 7)) obj arg0) - ) + (call-parent-method obj arg0) ) (defmethod nav-enemy-method-167 predator ((obj predator)) diff --git a/goal_src/jak2/levels/forest/wren.gc b/goal_src/jak2/levels/forest/wren.gc index 780a120b9b..2a1c616103 100644 --- a/goal_src/jak2/levels/forest/wren.gc +++ b/goal_src/jak2/levels/forest/wren.gc @@ -429,7 +429,6 @@ If so, it transitions from [[wren::peck]] to [[wren::hunt]]" ) ) -;; WARN: Return type mismatch process-drawable vs wren. (defmethod relocate wren ((obj wren) (arg0 int)) (dotimes (v1-0 2) (when (-> obj fly-curve v1-0) @@ -438,7 +437,7 @@ If so, it transitions from [[wren::peck]] to [[wren::hunt]]" ) ) ) - (the-as wren ((the-as (function process-drawable int process-drawable) (find-parent-method wren 7)) obj arg0)) + (call-parent-method obj arg0) ) ;; WARN: Return type mismatch object vs none. diff --git a/goal_src/jak2/levels/fortress/dump/fordumpc-obs.gc b/goal_src/jak2/levels/fortress/dump/fordumpc-obs.gc index 7c310dcce2..7b142dd8b4 100644 --- a/goal_src/jak2/levels/fortress/dump/fordumpc-obs.gc +++ b/goal_src/jak2/levels/fortress/dump/fordumpc-obs.gc @@ -380,7 +380,7 @@ This commonly includes things such as: (defmethod deactivate fort-missile-target ((obj fort-missile-target)) (sound-stop (the-as sound-id (-> obj sound-id))) - ((the-as (function process-drawable none) (find-parent-method fort-missile-target 10)) obj) + (call-parent-method obj) (none) ) @@ -921,15 +921,11 @@ This commonly includes things such as: (none) ) -;; WARN: Return type mismatch process-drawable vs fort-missile. (defmethod relocate fort-missile ((obj fort-missile) (arg0 int)) (if (nonzero? (-> obj part-doom)) (&+! (-> obj part-doom) arg0) ) - (the-as - fort-missile - ((the-as (function process-drawable int process-drawable) (find-parent-method fort-missile 7)) obj arg0) - ) + (call-parent-method obj arg0) ) ;; WARN: Return type mismatch object vs none. diff --git a/goal_src/jak2/levels/fortress/dump/fort-robotank-turret.gc b/goal_src/jak2/levels/fortress/dump/fort-robotank-turret.gc index 67eda141de..1d62a33104 100644 --- a/goal_src/jak2/levels/fortress/dump/fort-robotank-turret.gc +++ b/goal_src/jak2/levels/fortress/dump/fort-robotank-turret.gc @@ -326,7 +326,7 @@ (defmethod deactivate fort-roboscreen ((obj fort-roboscreen)) (disable *screen-filter*) (set-roboscreen-alpha! 0.0) - ((the-as (function process-drawable none) (find-parent-method fort-roboscreen 10)) obj) + (call-parent-method obj) (none) ) diff --git a/goal_src/jak2/levels/fortress/dump/fort-robotank.gc b/goal_src/jak2/levels/fortress/dump/fort-robotank.gc index 45068097e7..0e99fec1d2 100644 --- a/goal_src/jak2/levels/fortress/dump/fort-robotank.gc +++ b/goal_src/jak2/levels/fortress/dump/fort-robotank.gc @@ -944,7 +944,6 @@ (none) ) -;; WARN: Return type mismatch process-drawable vs fort-robotank. (defmethod relocate fort-robotank ((obj fort-robotank) (arg0 int)) (if (nonzero? (-> obj barrel-part)) (&+! (-> obj barrel-part) arg0) @@ -993,10 +992,7 @@ ) ) ) - (the-as - fort-robotank - ((the-as (function process-drawable int process-drawable) (find-parent-method fort-robotank 7)) obj arg0) - ) + (call-parent-method obj arg0) ) ;; WARN: Return type mismatch object vs none. diff --git a/goal_src/jak2/levels/fortress/rescue/forresca-obs.gc b/goal_src/jak2/levels/fortress/rescue/forresca-obs.gc index 7a35e8b99c..b0bb49eeb6 100644 --- a/goal_src/jak2/levels/fortress/rescue/forresca-obs.gc +++ b/goal_src/jak2/levels/fortress/rescue/forresca-obs.gc @@ -254,7 +254,7 @@ This commonly includes things such as: (defstate shutdown (elec-lock-gate) :virtual #t :enter (behavior () - (let ((t9-1 (-> (the-as state (find-parent-method elec-lock-gate 22)) enter))) + (let ((t9-1 (-> (the-as state (find-parent-state)) enter))) (if t9-1 ((the-as (function none) t9-1)) ) diff --git a/goal_src/jak2/levels/fortress/rescue/forrescb-obs.gc b/goal_src/jak2/levels/fortress/rescue/forrescb-obs.gc index 017ba9d3b9..12488d0cc4 100644 --- a/goal_src/jak2/levels/fortress/rescue/forrescb-obs.gc +++ b/goal_src/jak2/levels/fortress/rescue/forrescb-obs.gc @@ -391,7 +391,7 @@ This commonly includes things such as: (defmethod deactivate fort-elec-belt-inst ((obj fort-elec-belt-inst)) (sound-stop (-> obj sound-id)) - ((the-as (function process-drawable none) (find-parent-method fort-elec-belt-inst 10)) obj) + (call-parent-method obj) (none) ) diff --git a/goal_src/jak2/levels/gungame/gungame-obs.gc b/goal_src/jak2/levels/gungame/gungame-obs.gc index 946596a08e..80aa4d5c1a 100644 --- a/goal_src/jak2/levels/gungame/gungame-obs.gc +++ b/goal_src/jak2/levels/gungame/gungame-obs.gc @@ -149,7 +149,7 @@ ) (training-manager-method-24 obj) (training-manager-method-25 obj) - ((the-as (function process none) (find-parent-method training-manager 10)) obj) + (call-parent-method obj) (none) ) diff --git a/goal_src/jak2/levels/hiphog/whack.gc b/goal_src/jak2/levels/hiphog/whack.gc index c13e5a4ef2..e67f508572 100644 --- a/goal_src/jak2/levels/hiphog/whack.gc +++ b/goal_src/jak2/levels/hiphog/whack.gc @@ -1697,21 +1697,17 @@ (kill-and-free-particles (-> obj score-part s5-0)) ) ) - ((the-as (function process none) (find-parent-method whack-a-metal 10)) obj) + (call-parent-method obj) (none) ) -;; WARN: Return type mismatch process-drawable vs whack-a-metal. (defmethod relocate whack-a-metal ((obj whack-a-metal) (arg0 int)) (dotimes (v1-0 2) (if (nonzero? (-> obj score-part v1-0)) (&+! (-> obj score-part v1-0) arg0) ) ) - (the-as - whack-a-metal - ((the-as (function process-drawable int process-drawable) (find-parent-method whack-a-metal 7)) obj arg0) - ) + (call-parent-method obj arg0) ) (defmethod whack-a-metal-method-29 whack-a-metal ((obj whack-a-metal) (arg0 int) (arg1 int)) diff --git a/goal_src/jak2/levels/intro/intro-obs.gc b/goal_src/jak2/levels/intro/intro-obs.gc index 1f01e738da..987059edef 100644 --- a/goal_src/jak2/levels/intro/intro-obs.gc +++ b/goal_src/jak2/levels/intro/intro-obs.gc @@ -347,17 +347,13 @@ This commonly includes things such as: ) ) -;; WARN: Return type mismatch process vs metalhead-spawner. (defmethod relocate metalhead-spawner ((obj metalhead-spawner) (arg0 int)) (dotimes (v1-0 19) (if (nonzero? (-> obj path-tbl v1-0)) (&+! (-> obj path-tbl v1-0) arg0) ) ) - (the-as - metalhead-spawner - ((the-as (function process int process) (find-parent-method metalhead-spawner 7)) obj arg0) - ) + (call-parent-method obj arg0) ) ;; WARN: Return type mismatch object vs none. diff --git a/goal_src/jak2/levels/mountain/mountain-obs.gc b/goal_src/jak2/levels/mountain/mountain-obs.gc index 6f2eecd644..7ec76826d0 100644 --- a/goal_src/jak2/levels/mountain/mountain-obs.gc +++ b/goal_src/jak2/levels/mountain/mountain-obs.gc @@ -3186,7 +3186,7 @@ This commonly includes things such as: (task-arrow-spawn gp-0 self) ) ) - (let ((t9-5 (-> (the-as state (find-parent-method trans-plat 34)) enter))) + (let ((t9-5 (-> (the-as state (find-parent-state)) enter))) (if t9-5 ((the-as (function none) t9-5)) ) @@ -3196,7 +3196,7 @@ This commonly includes things such as: (while (-> self child) (deactivate (-> self child 0)) ) - (let ((t9-2 (-> (the-as state (find-parent-method trans-plat 34)) exit))) + (let ((t9-2 (-> (the-as state (find-parent-state)) exit))) (if t9-2 (t9-2) ) @@ -3220,7 +3220,7 @@ This commonly includes things such as: 0 ) ) - (let ((t9-2 (-> (the-as state (find-parent-method trans-plat 34)) trans))) + (let ((t9-2 (-> (the-as state (find-parent-state)) trans))) (if t9-2 (t9-2) ) diff --git a/goal_src/jak2/levels/mountain/rhino.gc b/goal_src/jak2/levels/mountain/rhino.gc index 9a71b718cb..2730b15f89 100644 --- a/goal_src/jak2/levels/mountain/rhino.gc +++ b/goal_src/jak2/levels/mountain/rhino.gc @@ -1625,15 +1625,11 @@ (none) ) -;; WARN: Return type mismatch process-focusable vs rhino. (defmethod relocate rhino ((obj rhino) (arg0 int)) (if (nonzero? (-> obj path-intro)) (&+! (-> obj path-intro) arg0) ) - (the-as - rhino - ((the-as (function process-focusable int process-focusable) (find-parent-method rhino 7)) obj arg0) - ) + (call-parent-method obj arg0) ) (defmethod init-enemy! rhino ((obj rhino)) diff --git a/goal_src/jak2/levels/nest/flying-spider.gc b/goal_src/jak2/levels/nest/flying-spider.gc index 5ce9741fb1..ad876d5a9b 100644 --- a/goal_src/jak2/levels/nest/flying-spider.gc +++ b/goal_src/jak2/levels/nest/flying-spider.gc @@ -18,14 +18,11 @@ ) -;; WARN: Return type mismatch sound-id vs none. +;; WARN: Return type mismatch object vs none. (defmethod play-impact-sound flying-spider-shot ((obj flying-spider-shot) (arg0 projectile-options)) (if (zero? arg0) (sound-play "fly-spider-shot") - ((the-as (function projectile projectile-options sound-id) (find-parent-method flying-spider-shot 28)) - obj - arg0 - ) + (call-parent-method obj arg0) ) (none) ) diff --git a/goal_src/jak2/levels/nest/mammoth.gc b/goal_src/jak2/levels/nest/mammoth.gc index 39379c0934..a1cd55ea36 100644 --- a/goal_src/jak2/levels/nest/mammoth.gc +++ b/goal_src/jak2/levels/nest/mammoth.gc @@ -1490,17 +1490,13 @@ #f ) -;; WARN: Return type mismatch process-focusable vs mammoth. (defmethod relocate mammoth ((obj mammoth) (arg0 int)) (dotimes (v1-0 4) (if (nonzero? (-> obj joint-ik v1-0)) (&+! (-> obj joint-ik v1-0) arg0) ) ) - (the-as - mammoth - ((the-as (function process-focusable int process-focusable) (find-parent-method mammoth 7)) obj arg0) - ) + (call-parent-method obj arg0) ) (defmethod init-enemy-collision! mammoth ((obj mammoth)) diff --git a/goal_src/jak2/levels/nest/mantis.gc b/goal_src/jak2/levels/nest/mantis.gc index 57c34f62b0..9afa3406b2 100644 --- a/goal_src/jak2/levels/nest/mantis.gc +++ b/goal_src/jak2/levels/nest/mantis.gc @@ -404,7 +404,7 @@ (defstate active (mantis) :virtual #t :trans (behavior () - (let ((t9-1 (-> (the-as (state enemy) (find-parent-method mantis 32)) trans))) + (let ((t9-1 (-> (the-as (state enemy) (find-parent-state)) trans))) (if t9-1 (t9-1) ) diff --git a/goal_src/jak2/levels/palace/cable/palcab-obs.gc b/goal_src/jak2/levels/palace/cable/palcab-obs.gc index 3a91b14f3d..f7fae0d0fb 100644 --- a/goal_src/jak2/levels/palace/cable/palcab-obs.gc +++ b/goal_src/jak2/levels/palace/cable/palcab-obs.gc @@ -915,7 +915,7 @@ This commonly includes things such as: (defmethod deactivate pal-rot-gun ((obj pal-rot-gun)) (sound-stop (-> obj sound-id)) (sound-stop (-> obj shot-sound-id)) - ((the-as (function process-drawable none) (find-parent-method pal-rot-gun 10)) obj) + (call-parent-method obj) (none) ) diff --git a/goal_src/jak2/levels/ruins/rapid-gunner.gc b/goal_src/jak2/levels/ruins/rapid-gunner.gc index 68657bce1f..26189165aa 100644 --- a/goal_src/jak2/levels/ruins/rapid-gunner.gc +++ b/goal_src/jak2/levels/ruins/rapid-gunner.gc @@ -1413,15 +1413,11 @@ (none) ) -;; WARN: Return type mismatch process-focusable vs rapid-gunner. (defmethod relocate rapid-gunner ((obj rapid-gunner) (arg0 int)) (if (nonzero? (-> obj joint)) (&+! (-> obj joint) arg0) ) - (the-as - rapid-gunner - ((the-as (function process-focusable int process-focusable) (find-parent-method rapid-gunner 7)) obj arg0) - ) + (call-parent-method obj arg0) ) (defmethod init-enemy! rapid-gunner ((obj rapid-gunner)) diff --git a/goal_src/jak2/levels/ruins/ruins-obs.gc b/goal_src/jak2/levels/ruins/ruins-obs.gc index b508833da9..e4ce4a68ae 100644 --- a/goal_src/jak2/levels/ruins/ruins-obs.gc +++ b/goal_src/jak2/levels/ruins/ruins-obs.gc @@ -23,7 +23,7 @@ ) (defmethod rigid-body-object-method-29 sinking-plat ((obj sinking-plat) (arg0 float)) - ((the-as (function rigid-body-platform float none) (find-parent-method sinking-plat 29)) obj arg0) + (call-parent-method obj arg0) (rigid-body-platform-method-56 obj (-> obj anchor-point)) 0 (none) diff --git a/goal_src/jak2/levels/sewer/hosehead.gc b/goal_src/jak2/levels/sewer/hosehead.gc index b8b9d43a58..9096b9577a 100644 --- a/goal_src/jak2/levels/sewer/hosehead.gc +++ b/goal_src/jak2/levels/sewer/hosehead.gc @@ -2186,7 +2186,6 @@ ) ) -;; WARN: Return type mismatch none vs hosehead. (defmethod relocate hosehead ((obj hosehead) (arg0 int)) (if (nonzero? (-> obj head-joint-mod)) (&+! (-> obj head-joint-mod) arg0) @@ -2196,7 +2195,7 @@ (&+! (-> obj joint-ik v1-4) arg0) ) ) - (the-as hosehead ((the-as (function process-drawable int none) (find-parent-method hosehead 7)) obj arg0)) + (call-parent-method obj arg0) ) (defmethod init-enemy! hosehead ((obj hosehead)) diff --git a/goal_src/jak2/levels/sewer/sew-gunturret.gc b/goal_src/jak2/levels/sewer/sew-gunturret.gc index c8c0afa8bd..aa2f253a76 100644 --- a/goal_src/jak2/levels/sewer/sew-gunturret.gc +++ b/goal_src/jak2/levels/sewer/sew-gunturret.gc @@ -1166,7 +1166,7 @@ (defmethod fire-turret! pal-gun-turret ((obj pal-gun-turret) (arg0 symbol)) "@overrides Calls [[sew-gunturret::140]] but also customizes the turret flash via [[set-palcab-turret-flash!]]" - ((the-as (function sew-gunturret symbol none) (find-parent-method pal-gun-turret 140)) obj arg0) + (call-parent-method obj arg0) (set-palcab-turret-flash! 1.0) ) diff --git a/goal_src/jak2/levels/sewer/sewer-obs2.gc b/goal_src/jak2/levels/sewer/sewer-obs2.gc index 31aa4bcc3c..495f929930 100644 --- a/goal_src/jak2/levels/sewer/sewer-obs2.gc +++ b/goal_src/jak2/levels/sewer/sewer-obs2.gc @@ -136,7 +136,7 @@ (defmethod deactivate sew-elevator ((obj sew-elevator)) (sound-stop (-> obj sound-id)) - ((the-as (function elevator none) (find-parent-method sew-elevator 10)) obj) + (call-parent-method obj) (none) ) @@ -313,15 +313,11 @@ For example for an elevator pre-compute the distance between the first and last ) ) -;; WARN: Return type mismatch process-drawable vs sew-valve. (defmethod relocate sew-valve ((obj sew-valve) (arg0 int)) (if (nonzero? (-> obj joint)) (&+! (-> obj joint) arg0) ) - (the-as - sew-valve - ((the-as (function process-drawable int process-drawable) (find-parent-method sew-valve 7)) obj arg0) - ) + (call-parent-method obj arg0) ) ;; WARN: Return type mismatch object vs none. diff --git a/goal_src/jak2/levels/stadium/racebike.gc b/goal_src/jak2/levels/stadium/racebike.gc index 408f2feafd..56f3bbedcf 100644 --- a/goal_src/jak2/levels/stadium/racebike.gc +++ b/goal_src/jak2/levels/stadium/racebike.gc @@ -767,15 +767,11 @@ ) -;; WARN: Return type mismatch process-drawable vs vehicle-race-bike. (defmethod relocate vehicle-race-bike ((obj vehicle-race-bike) (arg0 int)) (if (nonzero? (-> obj steering-wheel)) (&+! (-> obj steering-wheel) arg0) ) - (the-as - vehicle-race-bike - ((the-as (function process-drawable int process-drawable) (find-parent-method vehicle-race-bike 7)) obj arg0) - ) + (call-parent-method obj arg0) ) (defmethod update-joint-mods vehicle-race-bike ((obj vehicle-race-bike)) diff --git a/goal_src/jak2/levels/stadium/skate/skatea-obs.gc b/goal_src/jak2/levels/stadium/skate/skatea-obs.gc index 6f3902ddd4..a470c5def0 100644 --- a/goal_src/jak2/levels/stadium/skate/skatea-obs.gc +++ b/goal_src/jak2/levels/stadium/skate/skatea-obs.gc @@ -1313,7 +1313,7 @@ (defmethod deactivate hoverboard-training-manager ((obj hoverboard-training-manager)) (send-event *traffic-manager* 'restore-default-settings) - ((the-as (function process none) (find-parent-method hoverboard-training-manager 10)) obj) + (call-parent-method obj) (none) ) diff --git a/goal_src/jak2/levels/stadium/stadium-obs.gc b/goal_src/jak2/levels/stadium/stadium-obs.gc index 002814009e..882a785f54 100644 --- a/goal_src/jak2/levels/stadium/stadium-obs.gc +++ b/goal_src/jak2/levels/stadium/stadium-obs.gc @@ -945,7 +945,7 @@ This commonly includes things such as: (if (< 40960.0 (-> arg0 impulse)) (sound-play "rift-fall") ) - ((the-as (function rigid-body-object rigid-body-impact none) (find-parent-method rift-rider 45)) obj arg0) + (call-parent-method obj arg0) (none) ) @@ -1012,7 +1012,7 @@ This commonly includes things such as: (defmethod deactivate rift-rider ((obj rift-rider)) (sound-stop (-> obj sound-id)) - ((the-as (function rigid-body-object none) (find-parent-method rift-rider 10)) obj) + (call-parent-method obj) (none) ) @@ -1968,7 +1968,7 @@ This commonly includes things such as: (send-event (handle->process (-> obj hud)) 'hide-and-die) ) (kill-lightning obj) - ((the-as (function process-focusable none) (find-parent-method stad-samos 10)) obj) + (call-parent-method obj) (none) ) diff --git a/goal_src/jak2/levels/strip/strip-obs.gc b/goal_src/jak2/levels/strip/strip-obs.gc index d54e05dd72..95a0663a44 100644 --- a/goal_src/jak2/levels/strip/strip-obs.gc +++ b/goal_src/jak2/levels/strip/strip-obs.gc @@ -365,15 +365,11 @@ This commonly includes things such as: ) ) -;; WARN: Return type mismatch strip-hazard vs pitspikes. (defmethod relocate pitspikes ((obj pitspikes) (arg0 int)) (if (nonzero? (-> obj spinner)) (&+! (-> obj spinner) arg0) ) - (the-as - pitspikes - ((the-as (function strip-hazard int strip-hazard) (find-parent-method pitspikes 7)) obj arg0) - ) + (call-parent-method obj arg0) ) ;; WARN: Return type mismatch object vs none. diff --git a/goal_src/jak2/levels/tomb/tomb-beetle.gc b/goal_src/jak2/levels/tomb/tomb-beetle.gc index 766899bd66..b60de80a5a 100644 --- a/goal_src/jak2/levels/tomb/tomb-beetle.gc +++ b/goal_src/jak2/levels/tomb/tomb-beetle.gc @@ -301,7 +301,7 @@ :enter (behavior () (set! (-> self root trans quad) (-> self entity extra trans quad)) (quaternion-copy! (-> self root quat) (-> self entity quat)) - (let ((t9-2 (-> (the-as (state enemy) (find-parent-method tomb-beetle 27)) enter))) + (let ((t9-2 (-> (the-as (state enemy) (find-parent-state)) enter))) (if t9-2 (t9-2) ) diff --git a/goal_src/jak2/levels/tomb/tomb-obs.gc b/goal_src/jak2/levels/tomb/tomb-obs.gc index 0b4b2c1701..ff78b4c4ef 100644 --- a/goal_src/jak2/levels/tomb/tomb-obs.gc +++ b/goal_src/jak2/levels/tomb/tomb-obs.gc @@ -1573,7 +1573,7 @@ This commonly includes things such as: (defmethod deactivate tomb-plat-return ((obj tomb-plat-return)) (sound-stop (-> obj sound-id)) - ((the-as (function process-drawable none) (find-parent-method tomb-plat-return 10)) obj) + (call-parent-method obj) (none) ) @@ -1914,7 +1914,7 @@ This commonly includes things such as: (defmethod deactivate tomb-sphinx ((obj tomb-sphinx)) (sound-stop (-> obj sound-id)) - ((the-as (function process-drawable none) (find-parent-method tomb-sphinx 10)) obj) + (call-parent-method obj) (none) ) diff --git a/goal_src/jak2/levels/tomb/tomb-water.gc b/goal_src/jak2/levels/tomb/tomb-water.gc index 89424a5928..fa462ddb90 100644 --- a/goal_src/jak2/levels/tomb/tomb-water.gc +++ b/goal_src/jak2/levels/tomb/tomb-water.gc @@ -632,7 +632,7 @@ This commonly includes things such as: ) ) :trans (behavior () - (let ((t9-1 (-> (the-as (state basebutton) (find-parent-method tomb-beetle-button 30)) trans))) + (let ((t9-1 (-> (the-as (state basebutton) (find-parent-state)) trans))) (if t9-1 (t9-1) ) diff --git a/goal_src/jak2/levels/tomb/widow-extras.gc b/goal_src/jak2/levels/tomb/widow-extras.gc index 405242c206..94a5596339 100644 --- a/goal_src/jak2/levels/tomb/widow-extras.gc +++ b/goal_src/jak2/levels/tomb/widow-extras.gc @@ -1193,11 +1193,10 @@ This commonly includes things such as: (if (nonzero? (-> obj skid-part)) (kill-and-free-particles (-> obj warning-spark-part)) ) - ((the-as (function process-drawable none) (find-parent-method widow-bomb 10)) obj) + (call-parent-method obj) (none) ) -;; WARN: Return type mismatch process-drawable vs widow-bomb. (defmethod relocate widow-bomb ((obj widow-bomb) (arg0 int)) (if (nonzero? (-> obj explode-part)) (&+! (-> obj explode-part) arg0) @@ -1217,10 +1216,7 @@ This commonly includes things such as: (if (nonzero? (-> obj spin-jm)) (&+! (-> obj spin-jm) arg0) ) - (the-as - widow-bomb - ((the-as (function process-drawable int process-drawable) (find-parent-method widow-bomb 7)) obj arg0) - ) + (call-parent-method obj arg0) ) (defbehavior widow-bomb-reaction widow ((arg0 control-info) (arg1 collide-query) (arg2 vector) (arg3 vector)) @@ -1568,19 +1564,15 @@ This commonly includes things such as: (if (nonzero? (-> obj explode-part)) (kill-and-free-particles (-> obj explode-part)) ) - ((the-as (function process-drawable none) (find-parent-method tomb-boss-pillar 10)) obj) + (call-parent-method obj) (none) ) -;; WARN: Return type mismatch process-drawable vs tomb-boss-pillar. (defmethod relocate tomb-boss-pillar ((obj tomb-boss-pillar) (arg0 int)) (if (nonzero? (-> obj explode-part)) (&+! (-> obj explode-part) arg0) ) - (the-as - tomb-boss-pillar - ((the-as (function process-drawable int process-drawable) (find-parent-method tomb-boss-pillar 7)) obj arg0) - ) + (call-parent-method obj arg0) ) ;; WARN: Return type mismatch object vs none. diff --git a/goal_src/jak2/levels/under/jellyfish.gc b/goal_src/jak2/levels/under/jellyfish.gc index e8fe35bb27..827b64d346 100644 --- a/goal_src/jak2/levels/under/jellyfish.gc +++ b/goal_src/jak2/levels/under/jellyfish.gc @@ -401,7 +401,7 @@ (defstate stare (jellyfish) :virtual #t :enter (behavior () - (let ((t9-1 (-> (the-as (state enemy) (find-parent-method jellyfish 35)) enter))) + (let ((t9-1 (-> (the-as (state enemy) (find-parent-state)) enter))) (if t9-1 (t9-1) ) @@ -1166,7 +1166,7 @@ (defmethod deactivate jellyfish ((obj jellyfish)) (sound-stop (-> obj sound-id)) - ((the-as (function process-drawable none) (find-parent-method jellyfish 10)) obj) + (call-parent-method obj) (none) ) diff --git a/goal_src/jak2/levels/under/under-obs.gc b/goal_src/jak2/levels/under/under-obs.gc index d1bf58811c..62ba3473a8 100644 --- a/goal_src/jak2/levels/under/under-obs.gc +++ b/goal_src/jak2/levels/under/under-obs.gc @@ -866,7 +866,7 @@ This commonly includes things such as: ) (defmethod rigid-body-object-method-29 under-buoy-plat ((obj under-buoy-plat) (arg0 float)) - ((the-as (function rigid-body-object float none) (find-parent-method under-buoy-plat 29)) obj arg0) + (call-parent-method obj arg0) (rigid-body-platform-method-56 obj (-> obj orig-trans)) 0 (none) @@ -1563,7 +1563,7 @@ This commonly includes things such as: (defmethod deactivate under-lift ((obj under-lift)) (sound-stop (-> obj sound-id)) - ((the-as (function process-drawable none) (find-parent-method under-lift 10)) obj) + (call-parent-method obj) (none) ) diff --git a/goal_src/jak2/levels/under/under-shoot-block.gc b/goal_src/jak2/levels/under/under-shoot-block.gc index 2351fd03e1..178f6a2b6f 100644 --- a/goal_src/jak2/levels/under/under-shoot-block.gc +++ b/goal_src/jak2/levels/under/under-shoot-block.gc @@ -2201,7 +2201,7 @@ ) ) ) - ((the-as (function process-drawable none) (find-parent-method under-shoot-block 10)) obj) + (call-parent-method obj) (none) ) diff --git a/test/decompiler/reference/jak2/decompiler-macros.gc b/test/decompiler/reference/jak2/decompiler-macros.gc index e9c4694430..61e94786bd 100644 --- a/test/decompiler/reference/jak2/decompiler-macros.gc +++ b/test/decompiler/reference/jak2/decompiler-macros.gc @@ -464,6 +464,10 @@ (set! *defstate-type-stack* '()) `(none) ) + +(seval (define *defstate-current-type* #f)) +(seval (define *defstate-current-state-name* #f)) + ;; *no-state* is just used for the compiler to know whether a handler was actually set or not (defmacro defstate (state-name parents &key (virtual #f) @@ -483,6 +487,10 @@ *defstate-type-stack*) ) (set! *defstate-type-stack* '()) + (when virtual + (set! *defstate-current-type* defstate-type) + (set! *defstate-current-state-name* state-name) + ) ;; check for default handlers (let ((default-handlers (assoc defstate-type *default-state-handlers*))) (when default-handlers @@ -545,6 +553,23 @@ ) ) +(defmacro find-parent-state () + (when (or (not *defstate-current-type*) + (not *defstate-current-state-name*)) + (error "use of find-parent-state outside of a defstate.") + ) + `(cast-to-method-type + ,*defstate-current-type* + ,*defstate-current-state-name* + (find-parent-method ,*defstate-current-type* (method-id-of-type ,*defstate-current-type* ,*defstate-current-state-name*)) + ) + ) + +(defmacro call-parent-method (&rest args) + `((the (current-method-function-type) (find-parent-method (current-method-type) (current-method-id))) + ,@args) + ) + (defmacro behavior (bindings &rest body) "Define an anonymous behavior for a process state. This may only be used inside a defstate!"