MeridiusIX / Modular-Encounters-Systems

Modular Encounters Systems is a Massive NPC Management Framework for the game Space Engineers
54 stars 21 forks source link

Add static grid check for NPCShieldProvider #302

Open stubkan opened 1 month ago

stubkan commented 1 month ago

Will provide a simple fix for issue https://github.com/MeridiusIX/Modular-Encounters-Systems/issues/301

This simple PR adds a simple check to the checks before starting NPCShieldProvider block manipulation on a prefab - the added check is if it is a static grid or not.

As NPCShieldProvider provided shields do not work on static grids, this check will ensure a game using NPCShieldProviders is as functional as possible, by preventing Static grids from recieving broken shields while allowing normal non-static grids to recieve working shields normally.

Tested with vanilla prefabs and a range of MES mods. Appears to be working correctly.

The fact that static grids do not have working NPCShieldProvider shields may need to be addressed in a more in-depth future PR.

stubkan commented 1 month ago

Moved the function to a better location. It should not affect station static grids that have pre-existing shields now, and should activate those correctly.

CptArthur commented 1 month ago

Hey thanks for the PR.

Unfortunately, I am not available for a week to update MES. I will have to do it after that. Maybe Lucas can/will have a look at it.