111
This commit is contained in:
@@ -8,6 +8,23 @@
|
||||
#include "sqstdsystem.h"
|
||||
#include <iostream>
|
||||
|
||||
template <typename R, typename A, typename... ARG>
|
||||
R CallParty(A call_addr, const ARG... arguments)
|
||||
{
|
||||
if (!call_addr)
|
||||
{
|
||||
return R();
|
||||
}
|
||||
const auto control = reinterpret_cast<R (*)(ARG...)>(call_addr);
|
||||
try
|
||||
{
|
||||
return control(arguments...);
|
||||
}
|
||||
catch (...)
|
||||
{
|
||||
}
|
||||
return R();
|
||||
}
|
||||
typedef int (*__CreateParty)(void *CParty, void *CUser);
|
||||
static SQInteger Party_CreateParty(HSQUIRRELVM v)
|
||||
{
|
||||
@@ -44,6 +61,16 @@ static SQInteger Party_SendPartyIpInfo(HSQUIRRELVM v)
|
||||
((__SendPartyIpInfo)0x0859CEA2)(P);
|
||||
return 0;
|
||||
}
|
||||
// 获取战斗对象
|
||||
static SQInteger Party_GetBattle_Field(HSQUIRRELVM v)
|
||||
{
|
||||
SQUserPointer P;
|
||||
sq_getuserpointer(v, 2, &P);
|
||||
|
||||
sq_pushuserpointer(v, P + 2852);
|
||||
return 1;
|
||||
}
|
||||
|
||||
static SQInteger register_Party_func(HSQUIRRELVM v, SQFUNCTION f, const char *fname)
|
||||
{
|
||||
sq_pushroottable(v);
|
||||
@@ -63,4 +90,6 @@ static void RegisterParty(HSQUIRRELVM v)
|
||||
register_Party_func(v, Party_JoinParty, _SC("Sq_Party_JoinParty"));
|
||||
// 广播队伍玩家IP
|
||||
register_Party_func(v, Party_SendPartyIpInfo, _SC("Sq_Party_SendPartyIpInfo"));
|
||||
// 获取副本编号
|
||||
register_Party_func(v, Party_GetBattle_Field, _SC("Sq_Party_GetBattle_Field"));
|
||||
}
|
||||
Reference in New Issue
Block a user