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

◆ RegisterKill()

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

Definition at line 22 of file NPCKillsTracker.cs.

23 {
24 string bestiaryCreditId = npc.GetBestiaryCreditId();
26 value++;
28 {
29 _killCountsByNpcId[bestiaryCreditId] = Utils.Clamp(value, 0, 999999999);
30 }
31 if (Main.netMode == 2)
32 {
33 NetManager.Instance.Broadcast(NetBestiaryModule.SerializeKillCount(npc.netID, value));
34 }
35 }
bool TryGetValue(TKey key, [MaybeNullWhen(false)] out TValue value)
static NetPacket SerializeKillCount(int npcNetId, int killcount)
static readonly NetManager Instance
Definition NetManager.cs:18

References Terraria.GameContent.Bestiary.NPCKillsTracker._entryCreationLock, Terraria.GameContent.Bestiary.NPCKillsTracker._killCountsByNpcId, Terraria.NPC.GetBestiaryCreditId(), Terraria.Net.NetManager.Instance, Terraria.NPC.netID, Terraria.Main.netMode, Terraria.GameContent.NetModules.NetBestiaryModule.SerializeKillCount(), and System.Collections.Generic.Dictionary< TKey, TValue >.TryGetValue().