Fix compile for android.

This commit is contained in:
Relintai 2019-10-29 00:24:37 +01:00
parent 1994e023b2
commit 2a753972f5
2 changed files with 40 additions and 8 deletions

View File

@ -1007,7 +1007,7 @@ void Entity::sdie() {
son_death();
//send an event to client
VRPC(cdie);
VRPCN(cdie);
//signal
emit_signal("sdied", this);
@ -2842,13 +2842,13 @@ void Entity::sfail_cast() {
_s_spell_cast_info.unref();
VRPC(cfail_cast);
VRPCN(cfail_cast);
}
void Entity::sdelay_cast() {
emit_signal("scast_delayed", _s_spell_cast_info);
VRPC(cdelay_cast);
VRPCN(cdelay_cast);
}
void Entity::sfinish_cast() {
@ -2860,7 +2860,7 @@ void Entity::sfinish_cast() {
_s_spell_cast_info.unref();
VRPC(cfinish_cast);
VRPCN(cfinish_cast);
}
void Entity::sinterrupt_cast() {
@ -2874,7 +2874,7 @@ void Entity::sinterrupt_cast() {
_s_spell_cast_info.unref();
VRPC(cinterrupt_cast);
VRPCN(cinterrupt_cast);
}
void Entity::cstart_casting_rpc(String data) {
@ -3762,7 +3762,7 @@ void Entity::sreset_talents() {
emit_signal("stalent_reset", this);
ORPC(creset_talents);
ORPCN(creset_talents);
}
void Entity::creset_talents() {
_c_talents.clear();
@ -3827,7 +3827,7 @@ int Entity::gets_talent_count() {
void Entity::sclear_talents() {
_s_talents.clear();
ORPC(cclear_talents);
ORPCN(cclear_talents);
}
void Entity::addc_talent(int talent) {

View File

@ -80,6 +80,38 @@ enum PlayerSendFlags {
#define SET_RPC_MASTERSYNC(p_method_name) rpc_config(p_method_name, MultiplayerAPI::RPC_MODE_MASTERSYNC);
#define SET_RPC_PUPPETSYNC(p_method_name) rpc_config(p_method_name, MultiplayerAPI::RPC_MODE_PUPPETSYNC);
//Normal
#define RPCN(func) \
if (is_inside_tree() && get_tree()->has_network_peer()) { \
rpc(#func); \
} \
func();
#define VRPCN(func) \
if (is_inside_tree() && get_tree()->has_network_peer()) { \
vrpc(#func); \
} \
func();
#define ORPCN(func) \
if (is_inside_tree() && get_tree()->has_network_peer()) { \
if (get_tree()->is_network_server() && get_network_master() != 1) \
rpc_id(get_network_master(), #func); \
} \
func();
#define RPCSN(func) \
if (is_inside_tree() && get_tree()->has_network_peer()) { \
if (get_tree()->is_network_server()) { \
func(); \
} else { \
rpc_id(1, #func); \
} \
} else { \
func(); \
}
//Variadic
// f.e. RPC(method, arg0, arg1, etc)
#define RPC(func, ...) \
if (is_inside_tree() && get_tree()->has_network_peer()) { \
@ -477,7 +509,7 @@ public:
void sremove_aura_expired(Ref<AuraData> aura);
void sremove_aura_dispelled(Ref<AuraData> aura);
void saura_refreshed(Ref<AuraData> aura);
void cadd_aura_rpc(String data);
void cremove_aura_rpc(String data);
void cremove_aura_exact_rpc(String data);