Jump to content

error

Pending 1.1.1

pveJP
pveJP

Posted

Same issue here with 1.1.1. I believe the cause is EntityTools.CreateCustomEntity.
After the recent Rust update, BaseNetworkable.prefabID is a property backed by a private field declared in the base class. GetFields on the derived type doesn't return private fields of base classes (even with NonPublic), so prefabID stays 0 on AntiAirAutoTurret.
Result: "PrefabID is 0!" on saves, then a NullReferenceException in ResetState -> LookupPrefab when a turret is killed. That aborts the ship's Kill() halfway, and FixedUpdate keeps calling Ship.Kill(), so "already IsDestroyed" spams until restart.
Suggested fix: in CreateCustomEntity, before DestroyImmediate(entity, true), add:
customEntity.prefabID = entity.prefabID;
Setting it from a small helper plugin when the turret spawns does fix the ID (the turrets are no longer 0).

The_Kiiiing

Posted

I'm gonna release a fix for this later today

About Us

Codefling is the largest marketplace for plugins, maps, tools, and more, making it easy for customers to discover new content and for creators to monetize their work.

Downloads
3.3m
Total downloads
Customers
12.4k
Customers served
Files Sold
176.4k
Total sales
Payments
3.9m
Processed total
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.