TModLoader v1.4.4.9
TModLoader source code documentation
Loading...
Searching...
No Matches

◆ RegisterKill()

void Terraria.GameContent.Bestiary.NPCKillsTracker.RegisterKill ( NPC npc)
inline

Definition at line 23 of file NPCKillsTracker.cs.

24 {
25 string bestiaryCreditId = npc.GetBestiaryCreditId();
26 _killCountsByNpcId.TryGetValue(bestiaryCreditId, out var value);
27 value++;
29 {
30 _killCountsByNpcId[bestiaryCreditId] = Utils.Clamp(value, 0, 999999999);
31 }
32 if (Main.netMode == 2)
33 {
34 NetManager.Instance.Broadcast(NetBestiaryModule.SerializeKillCount(npc.netID, value));
35 }
36 }
static NetPacket SerializeKillCount(int npcNetId, int killcount)
static readonly NetManager Instance
Definition NetManager.cs:21

References Terraria.GameContent.Bestiary.NPCKillsTracker._entryCreationLock, Terraria.GameContent.Bestiary.NPCKillsTracker._killCountsByNpcId, Terraria.NPC.GetBestiaryCreditId(), Terraria.Net.NetManager.Instance, Terraria.NPC.netID, Terraria.Main.netMode, and Terraria.GameContent.NetModules.NetBestiaryModule.SerializeKillCount().

+ Here is the call graph for this function: