terraria-cpp2il-methodrecon v1.4.4.9
Terraria mobile dump, with reconstructed method body. Dump with CallAnalysis: https://infinitynichto.github.io/terraria-cpp2il
Loading...
Searching...
No Matches
NPCFollowState.cs
Go to the documentation of this file.
1using System;
2using System.IO;
4
6{
7 // Token: 0x02000639 RID: 1593
8 public class NPCFollowState
9 {
10 // Token: 0x1700069E RID: 1694
11 // (get) Token: 0x06003639 RID: 13881 RVA: 0x002126AC File Offset: 0x002108AC
13 {
14 get
15 {
16 float x = this._floorBreadcrumb.X;
17 float y = this._floorBreadcrumb.Y;
18 Vector2 vector;
19 return vector;
20 }
21 }
22
23 // Token: 0x1700069F RID: 1695
24 // (get) Token: 0x0600363A RID: 13882 RVA: 0x002126D4 File Offset: 0x002108D4
26 {
27 get
28 {
29 /*
30An exception occurred when decompiling this method (0600363A)
31
32ICSharpCode.Decompiler.DecompilerException: Error decompiling System.Boolean Terraria.DataStructures.NPCFollowState::get_IsFollowingPlayer()
33
34 ---> System.Exception: Basic block has to end with unconditional control flow.
35{
36 Block_0:
37 stloc:valuetype [mscorlib]System.Nullable`1<int32>(var_0_06, ldfld:valuetype [mscorlib]System.Nullable`1<int32>(NPCFollowState::_playerIndexBeingFollowed, ldloc:NPCFollowState(this)))
38}
39
40 at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.FlattenBasicBlocks(ILNode node) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 1852
41 at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.Optimize(DecompilerContext context, ILBlock method, AutoPropertyProvider autoPropertyProvider, StateMachineKind& stateMachineKind, MethodDef& inlinedMethod, AsyncMethodDebugInfo& asyncInfo, ILAstOptimizationStep abortBeforeStep) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 355
42 at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(IEnumerable`1 parameters, MethodDebugInfoBuilder& builder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 123
43 at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(MethodDef methodDef, DecompilerContext context, AutoPropertyProvider autoPropertyProvider, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, StringBuilder sb, MethodDebugInfoBuilder& stmtsBuilder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 88
44 --- End of inner exception stack trace ---
45 at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(MethodDef methodDef, DecompilerContext context, AutoPropertyProvider autoPropertyProvider, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, StringBuilder sb, MethodDebugInfoBuilder& stmtsBuilder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 92
46 at ICSharpCode.Decompiler.Ast.AstBuilder.AddMethodBody(EntityDeclaration methodNode, EntityDeclaration& updatedNode, MethodDef method, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, MethodKind methodKind) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstBuilder.cs:line 1683
47*/;
48 }
49 }
50
51 // Token: 0x170006A0 RID: 1696
52 // (get) Token: 0x0600363B RID: 13883 RVA: 0x002126E8 File Offset: 0x002108E8
54 {
55 get
56 {
58 if (playerIndexBeingFollowed == null || playerIndexBeingFollowed == null)
59 {
60 return;
61 }
62 }
63 }
64
65 // Token: 0x0600363C RID: 13884 RVA: 0x00212704 File Offset: 0x00210904
66 public void FollowPlayer(int playerIndex)
67 {
68 int num = 1;
70 if (num == 0)
71 {
72 }
73 NPC npc = this._npc;
74 int num2 = 1;
75 npc.netUpdate = num2 != 0;
76 }
77
78 // Token: 0x0600363D RID: 13885 RVA: 0x00212730 File Offset: 0x00210930
79 public void StopFollowing()
80 {
81 NPC npc = this._npc;
82 float[] ai = npc.ai;
83 npc.netUpdate = true;
84 }
85
86 // Token: 0x0600363E RID: 13886 RVA: 0x00212754 File Offset: 0x00210954
87 public void Clear(NPC npcToBelongTo)
88 {
90 }
91
92 // Token: 0x0600363F RID: 13887 RVA: 0x00212768 File Offset: 0x00210968
93 private bool ShouldSync()
94 {
95 return this._npc.isLikeATownNPC;
96 }
97
98 // Token: 0x06003640 RID: 13888 RVA: 0x00212780 File Offset: 0x00210980
99 public void WriteTo(BinaryWriter writer)
100 {
101 if (this._playerIndexBeingFollowed != null)
102 {
103 return;
104 }
105 }
106
107 // Token: 0x06003641 RID: 13889 RVA: 0x00212798 File Offset: 0x00210998
108 public void ReadFrom(BinaryReader reader)
109 {
110 }
111
112 // Token: 0x06003642 RID: 13890 RVA: 0x002127A8 File Offset: 0x002109A8
113 private void MoveNPCBackHome()
114 {
115 NPC npc = this._npc;
116 float[] ai = npc.ai;
117 npc.netUpdate = true;
118 }
119
120 // Token: 0x06003643 RID: 13891 RVA: 0x002127CC File Offset: 0x002109CC
121 public void Update()
122 {
123 if (this._playerIndexBeingFollowed != null)
124 {
126 NPC npc;
127 if (playerBeingFollowed.active && !playerBeingFollowed.dead)
128 {
129 this.UpdateBreadcrumbs(playerBeingFollowed);
130 float x = this._floorBreadcrumb.X;
131 float y = this._floorBreadcrumb.Y;
132 if (npc == null)
133 {
134 }
135 if (!true)
136 {
137 }
138 return;
139 }
140 npc = this._npc;
141 float[] ai = npc.ai;
142 npc.netUpdate = true;
143 }
144 }
145
146 // Token: 0x06003644 RID: 13892 RVA: 0x00212834 File Offset: 0x00210A34
147 private void UpdateBreadcrumbs(Player player)
148 {
149 float y = player.velocity.Y;
150 float gravDir = player.gravDir;
151 Vector2 bottom = player.Bottom;
152 if (true)
153 {
154 float x = this._floorBreadcrumb.X;
155 float y2 = this._floorBreadcrumb.Y;
156 if (!true)
157 {
158 }
159 NPC npc = this._npc;
160 this._floorBreadcrumb.X = gravDir;
161 npc.netUpdate = true;
162 }
163 }
164
165 // Token: 0x06003645 RID: 13893 RVA: 0x0021289C File Offset: 0x00210A9C
167 {
168 }
169
170 // Token: 0x040076FB RID: 30459
171 private NPC _npc;
172
173 // Token: 0x040076FC RID: 30460
175
176 // Token: 0x040076FD RID: 30461
178 }
179}
class f__AnonymousType0<< Count > j__TPar
void WriteTo(BinaryWriter writer)
Vector2 Bottom
Definition Entity.cs:318
Vector2 velocity
Definition Entity.cs:463
bool isLikeATownNPC
Definition NPC.cs:648
float[] ai
Definition NPC.cs:11384