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

◆ DeserializeNetAnchor()

static WorldUIAnchor Terraria.GameContent.UI.EmoteBubble.DeserializeNetAnchor ( int type,
int meta )
inlinestatic

Definition at line 137 of file EmoteBubble.cs.

138 {
139 int packedOwnerType = type;
140 type = packedOwnerType & 0xFF;
141 switch (type)
142 {
143 case 0:
144 return new WorldUIAnchor((Entity)Main.npc[meta]);
145 case 1:
146 return new WorldUIAnchor((Entity)Main.player[meta]);
147 case 2:
149 {
150 int owner = packedOwnerType >> 8;
151 int whoAmI = Main.maxProjectiles;
152 for (int i = 0; i < Main.maxProjectiles; i++)
153 {
154 Projectile projectile = Main.projectile[i];
155 if (projectile.owner == owner && projectile.identity == meta && projectile.active)
156 {
157 whoAmI = i;
158 break;
159 }
160 }
161 return new WorldUIAnchor((Entity)Main.projectile[whoAmI]);
162 }
163 return new WorldUIAnchor((Entity)Main.projectile[meta]);
164 default:
165 throw new Exception("How did you end up getting this?");
166 }
167 }
static bool AllowVanillaClients
Definition ModNet.cs:109

References Terraria.Entity.active, Terraria.ModLoader.ModNet.AllowVanillaClients, Terraria.Projectile.identity, Terraria.Main.maxProjectiles, Terraria.Main.npc, Terraria.Projectile.owner, Terraria.Main.player, and Terraria.Main.projectile.

Referenced by Terraria.MessageBuffer.GetData().

+ Here is the caller graph for this function: