diff options
author | Kissaki <kissaki@gmx.de> | 2012-06-05 20:32:27 +0400 |
---|---|---|
committer | Benjamin Jemlich <pcgod@users.sourceforge.net> | 2012-06-11 11:53:06 +0400 |
commit | 833c02eb2a12b7f4df059df58d1cdb1fdc3c71bb (patch) | |
tree | 846d48fe6707caec51c7018312bf340bf494ad7b /plugins/wolfet | |
parent | 7ec4f6a67cc6e7ef45516cb1decaa946542f2bd4 (diff) |
WolfET: fix string buffer termination and use more efficient peeking
Fix string buffer termination (was off by one).
Peek avatar pos with 1 call (3 subsequent floats).
(see comments on pullreq #87 upstream)
Diffstat (limited to 'plugins/wolfet')
-rw-r--r-- | plugins/wolfet/wolfet.cpp | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/plugins/wolfet/wolfet.cpp b/plugins/wolfet/wolfet.cpp index cb21549ee..be4897a55 100644 --- a/plugins/wolfet/wolfet.cpp +++ b/plugins/wolfet/wolfet.cpp @@ -92,9 +92,7 @@ static int fetch(float *avatar_pos, float *avatar_front, float *avatar_top, floa if (team == 0 || team == 3) return true; - ok = peekProc((BYTE *) 0x013E8CF4, avatar_pos, 4) && // X - peekProc((BYTE *) 0x013E8CF8, avatar_pos+1, 4) && // Y - peekProc((BYTE *) 0x013E8CFC, avatar_pos+2, 4) && // Z + ok = peekProc((BYTE *) 0x013E8CF4, avatar_pos, 12) && // X, Y, Z peekProc((BYTE *) 0x013F9E20, &viewHor, 4) && // Hor-Angle peekProc((BYTE *) 0x013F9E1C, &viewVer, 4); // Ver-Angle @@ -122,8 +120,8 @@ static int fetch(float *avatar_pos, float *avatar_front, float *avatar_top, floa char mapname[40]; ok = peekProc((BYTE *) 0x009FFD30, hostip, sizeof(hostip)) && peekProc((BYTE *) 0x010B4908, mapname, sizeof(hostip)); - hostip[sizeof(hostip)] = '\0'; - mapname[sizeof(mapname)] = '\0'; + hostip[sizeof(hostip)-1] = '\0'; + mapname[sizeof(mapname)-1] = '\0'; context = std::string(hostip) + mapname + (char)(team + 0x30); return true; |