Skip to content

Commit

Permalink
Fixed chat hooks not firing in single player.
Browse files Browse the repository at this point in the history
  • Loading branch information
bladecoding committed Oct 4, 2013
1 parent 69e4291 commit eb7c019
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
10 changes: 8 additions & 2 deletions Terraria/Terraria.il
Original file line number Diff line number Diff line change
Expand Up @@ -104301,17 +104301,23 @@
int32,
int32)
IL_16fb: ldsfld bool Terraria.Main::inputTextEnter
IL_1700: brfalse.s IL_177f
IL_1700: brfalse IL_177f

IL_1702: ldsfld bool Terraria.Main::chatRelease
IL_1707: brfalse.s IL_177f
IL_1707: brfalse IL_177f

IL_1709: ldsfld string Terraria.Main::chatText
IL_170e: ldstr ""
IL_1713: call bool [mscorlib]System.String::op_Inequality(string,
string)
IL_1718: brfalse.s IL_173d

//ADD ClientHooks - OnChat
ldsflda string Terraria.Main::chatText
call bool [TerrariaAPI]TerrariaAPI.Hooks.ClientHooks::OnChat(string&)
brtrue IL_173d
//-ADD-

IL_171a: ldc.i4.s 25
IL_171c: ldc.i4.m1
IL_171d: ldc.i4.m1
Expand Down
3 changes: 0 additions & 3 deletions TerrariaAPI/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -274,9 +274,6 @@ private static Assembly Compile(string name, string data, bool addfail = true)

private static void ClientHooks_Chat(ref string msg, HandledEventArgs e)
{
if (Main.netMode != 1)
return;

if (!msg.StartsWith("/preload"))
return;

Expand Down

0 comments on commit eb7c019

Please sign in to comment.