-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathaudServer.cpp
50 lines (44 loc) · 1.07 KB
/
audServer.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#include "stdafx.h"
int (__cdecl *audMakeSound)(int Snd,noxPoint *Pt,int A,int B);
int (__cdecl *audMakeSyll)(void *Player,int Syll);
extern "C" void initAudServer(lua_State *L);
namespace
{
int audSound(lua_State *L)
{
int i=1;
if (
(lua_type(L,i++)!=LUA_TNUMBER) ||
(lua_type(L,i++)!=LUA_TNUMBER) ||
(lua_type(L,i++)!=LUA_TNUMBER)
)
{
lua_pushstring(L,"wrong args!");
lua_error_(L);
}
audMakeSound(lua_tointeger(L,1),&noxPoint(lua_tonumber(L,2),lua_tonumber(L,3)),0,0);
return 0;
}
/* íå ðàáîòàåò - ëèáî òàéìàóòû ïîäâîäÿò, ëèáî íóæíî ñîñòîÿíèå Cast èãðîêó */
int audSyll(lua_State *L)
{
int i=1;
if (
(lua_type(L,i++)!=LUA_TLIGHTUSERDATA) ||
(lua_type(L,i++)!=LUA_TNUMBER)
)
{
lua_pushstring(L,"wrong args!");
lua_error_(L);
}
audMakeSyll(lua_touserdata(L,1),lua_tonumber(L,2));
return 0;
}
}
void initAudServer(lua_State *L)
{
ASSIGN(audMakeSyll,0x004FC960);
ASSIGN(audMakeSound,0x00501A30);
registerserver("soundMake",&audSound);
registerserver("soundSyll",&audSyll);
}