Skip to content

skip / remove ModLoaderStore.get("any_mod_hooked") check in export plugin #487

@KANAjetzt

Description

@KANAjetzt
          I think the` ModLoaderStore.get("any_mod_hooked")` kills all the performance-benefits of checking ModLoaderStore.any_mod_hooked. 

This was originally a way to reduce the modding overhead when running a modless version of a game.
2 topics:

  • can we somehow skip the ModLoaderStore.get("any_mod_hooked") call?
  • can we skip the check altogether when dynamically generating the scripts, since there we only create the methods when hooks actually exist.

(Same below on l.271)

Originally posted by @pirey0 in #408 (comment)

Note

#429 Removed this check from dynamic hook creation.

In addition to the mentioned performance issue, we currently have the following Parse error:
SCRIPT ERROR: Parse Error: Not all code paths return a value.

Example:

func check_sight(target_position: Vector3) -> bool:
	if ModLoaderStore.get("any_mod_hooked") and ModLoaderStore.any_mod_hooked:
		return _ModLoaderHooks.call_hooks(vanilla_608418131_check_sight, [target_position], 1845897103)

Metadata

Metadata

Assignees

Labels

4.xbugSomething isn't workingenhancementNew feature or request

Type

No type

Projects

Status

Done

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions