Skip to content

Commit 3124474

Browse files
committed
Update client mod for 1.4.4.8
1 parent 83ca422 commit 3124474

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

OTAPI.Scripts/Modules/OTAPI.Mods/ModNPC.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff 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

0 commit comments

Comments
 (0)