File tree Expand file tree Collapse file tree
OTAPI.Scripts/Modules/OTAPI.Mods Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -128,7 +128,11 @@ private static void NPC_Spawn(object? sender, Hooks.NPC.SpawnEventArgs e)
128128
129129 private static Terraria . Localization . LocalizedText Lang_GetNPCName ( On . Terraria . Lang . orig_GetNPCName orig , int netID )
130130 {
131+ #if TerrariaServer_1448_OrAbove || Terraria_1448_OrAbove
132+ if ( netID > Terraria . ID . NPCID . Count )
133+ #else
131134 if ( netID > Terraria . Main . maxNPCTypes )
135+ #endif
132136 {
133137 var rego = EntityDiscovery . Instance
134138 . GetTypeModRegistrations < ModNPC > ( )
@@ -235,7 +239,11 @@ public string GetName()
235239 public void Registered ( )
236240 {
237241 // setup this type for instancing later on when the NPC needs to be spawned.
242+ #if TerrariaServer_1448_OrAbove || Terraria_1448_OrAbove
243+ TypeID = IModRegistry . AllocateType < ModNPC > ( Terraria . ID . NPCID . Count ) ;
244+ #else
238245 TypeID = IModRegistry . AllocateType < ModNPC > ( Terraria . Main . maxNPCTypes ) ;
246+ #endif
239247
240248 var name = this . Name ? . Key ;
241249
You can’t perform that action at this time.
0 commit comments