jak-project/goal_src/jak2/engine/target
ManDude fe491c2b5e
[opengoal] make none a child of object (#3001)
Previously, `object` and `none` were both top-level types. This made
decompilation rather messy as they have no LCA and resulted in a lot of
variables coming out as type `none` which is very very wrong and
additionally there were plenty of casts to `object`. This changes it so
`none` becomes a child of `object` (it is still represented by
`NullType` which remains unusable in compilation).

This change makes `object` the sole top-level type, and the type that
can represent *any* GOAL object. I believe this matches the original
GOAL built-in type structure. A function that has a return type of
`object` can now return an integer or a `none` at the same time.
However, keep in mind that the return value of `(none)` is still
undefined, just as before. This also makes a cast to `object`
meaningless in 90% of the situations it showed up in (as every single
thing is already an `object`) and the decompiler will no longer emit
them. Casts to `none` are also reduced. Yay!

Additionally, state handlers also don't get the final `(none)` printed
out anymore. The return type of a state handler is completely
meaningless outside the event handler (which is return type `object`
anyway) so there are no limitations on what the last form needs to be. I
did this instead of making them return `object` to trick the decompiler
into not trying to output a variable to be used as a return value
(internally, in the decompiler they still have return type `none`, but
they have `object` elsewhere).

Fixes #1703 
Fixes #830 
Fixes #928
2023-09-22 10:54:49 +01:00
..
board [opengoal] make none a child of object (#3001) 2023-09-22 10:54:49 +01:00
gun [opengoal] make none a child of object (#3001) 2023-09-22 10:54:49 +01:00
mech [opengoal] make none a child of object (#3001) 2023-09-22 10:54:49 +01:00
collide-reaction-target.gc jak2: macro detection for launch-particles and seconds-per-frame, add og:preserve-this comments for manual patches (#2974) 2023-09-10 11:48:56 -04:00
darkjak-h.gc [jak2] fill in a lot of flags for decomp + mouse macros (#2927) 2023-08-22 16:39:52 +01:00
logic-target.gc [opengoal] make none a child of object (#3001) 2023-09-22 10:54:49 +01:00
sidekick.gc [opengoal] make none a child of object (#3001) 2023-09-22 10:54:49 +01:00
surface-h.gc d/jak2: finish process-drawable, collide-reaction-target, target-anim, almost target-part and gun-part (#2012) 2022-11-12 11:19:04 -05:00
target-anim.gc jak2: macro detection for launch-particles and seconds-per-frame, add og:preserve-this comments for manual patches (#2974) 2023-09-10 11:48:56 -04:00
target-carry.gc [opengoal] make none a child of object (#3001) 2023-09-22 10:54:49 +01:00
target-darkjak.gc [opengoal] make none a child of object (#3001) 2023-09-22 10:54:49 +01:00
target-death.gc [opengoal] make none a child of object (#3001) 2023-09-22 10:54:49 +01:00
target-gun.gc jak2: macro detection for launch-particles and seconds-per-frame, add og:preserve-this comments for manual patches (#2974) 2023-09-10 11:48:56 -04:00
target-h.gc [opengoal] make none a child of object (#3001) 2023-09-22 10:54:49 +01:00
target-handler.gc [opengoal] make none a child of object (#3001) 2023-09-22 10:54:49 +01:00
target-part.gc [opengoal] make none a child of object (#3001) 2023-09-22 10:54:49 +01:00
target-swim.gc [opengoal] make none a child of object (#3001) 2023-09-22 10:54:49 +01:00
target-tube.gc [opengoal] make none a child of object (#3001) 2023-09-22 10:54:49 +01:00
target-turret-shot.gc [opengoal] make none a child of object (#3001) 2023-09-22 10:54:49 +01:00
target-turret.gc [opengoal] make none a child of object (#3001) 2023-09-22 10:54:49 +01:00
target-util.gc [decompiler] decomp jak2 static-attack-info (#2992) 2023-09-15 19:32:57 +01:00
target.gc [opengoal] make none a child of object (#3001) 2023-09-22 10:54:49 +01:00
target2.gc [opengoal] make none a child of object (#3001) 2023-09-22 10:54:49 +01:00