From 4c716d90c840cdf98fd34cb75956d7da60a3e7f8 Mon Sep 17 00:00:00 2001 From: Calvin Balke Date: Tue, 24 Mar 2015 12:36:24 -0700 Subject: [PATCH] Added a new TSTick call to TSExtension This will allow running physics in TorqueScript with more accurate timing. Also added TSTick.cs which also enables InteriorInstance serverside movement support(Will allow clients to see movement without clientside patching). --- Mod Sources/TSExtension/TSExtension/source/DXConCmds.cpp | 9 ++++++--- Patches/TStick.cs | 3 +++ 2 files changed, 9 insertions(+), 3 deletions(-) create mode 100644 Patches/TStick.cs diff --git a/Mod Sources/TSExtension/TSExtension/source/DXConCmds.cpp b/Mod Sources/TSExtension/TSExtension/source/DXConCmds.cpp index a28fe34..06fb5a7 100644 --- a/Mod Sources/TSExtension/TSExtension/source/DXConCmds.cpp +++ b/Mod Sources/TSExtension/TSExtension/source/DXConCmds.cpp @@ -7,6 +7,9 @@ void serverProcessReplacement(unsigned int timeDelta) { unsigned int servertickaddr=0x602350; unsigned int serverthisptr=0x9E5EC0; + char test[256]=""; + sprintf (test,"TSTick(%f);",(float)timeDelta/1000); + Con::evaluate(test,false,NULL,false); __asm { mov ecx,serverthisptr @@ -20,8 +23,8 @@ const char* congetServPAddr(Linker::SimObject *obj, S32 argc, const char *argv[] char test[256] = ""; char test2[256]=""; int spr=(signed int)*serverProcessReplacement; - sprintf(test,"B8%8XFFD089EC5DC3",endian(spr)); - test2[0]=test[6]; + sprintf(test2,"B8%08XFFD089EC5DC3",endian(spr)); + /*test2[0]=test[6]; test2[1]=test[7]; test2[2]=test[4]; test2[3]=test[5]; @@ -29,7 +32,7 @@ const char* congetServPAddr(Linker::SimObject *obj, S32 argc, const char *argv[] test2[5]=test[3]; test2[6]=test[0]; test2[7]=test[1]; - test2[8]=0; + test2[8]=0;*/ return test2; } const char *conGetAddress(Linker::SimObject *obj, S32 argc, const char *argv[]) diff --git a/Patches/TStick.cs b/Patches/TStick.cs new file mode 100644 index 0000000..a7004c3 --- /dev/null +++ b/Patches/TStick.cs @@ -0,0 +1,3 @@ +function TStick(%tick) {} +memPatch("5240FD","B00190"); +memPatch("5BBBDC",getServPAddr()); \ No newline at end of file