Commit a6ddb761 authored by Chen Bill's avatar Chen Bill Committed by GitHub

replace intN to fixed width integer in C++11 (#688)

* remove int8

* replace int16_t

* replace int32_t

* replace int64_t

* replace uint16_t

* replace uint32_t

* replace uint64_t

* replace uint8_t
parent 68712749
This source diff could not be displayed because it is too large. You can view the blob instead.
This diff is collapsed.
......@@ -6,16 +6,16 @@
constexpr int CARD_ARTWORK_VERSIONS_OFFSET = 20;
constexpr int SIZE_SETCODE = 16;
constexpr uint32 CARD_BLACK_LUSTER_SOLDIER2 = 5405695;
constexpr uint32_t CARD_BLACK_LUSTER_SOLDIER2 = 5405695;
//double name
constexpr uint32 CARD_MARINE_DOLPHIN = 78734254;
constexpr uint32 CARD_TWINKLE_MOSS = 13857930;
constexpr uint32 CARD_TIMAEUS = 1784686;
constexpr uint32 CARD_CRITIAS = 11082056;
constexpr uint32 CARD_HERMOS = 46232525;
constexpr uint32_t CARD_MARINE_DOLPHIN = 78734254;
constexpr uint32_t CARD_TWINKLE_MOSS = 13857930;
constexpr uint32_t CARD_TIMAEUS = 1784686;
constexpr uint32_t CARD_CRITIAS = 11082056;
constexpr uint32_t CARD_HERMOS = 46232525;
const std::unordered_map<uint32, uint32> second_code = {
const std::unordered_map<uint32_t, uint32_t> second_code = {
{CARD_MARINE_DOLPHIN, 17955766u},
{CARD_TWINKLE_MOSS, 17732278u},
{CARD_TIMAEUS, 10000050u},
......@@ -24,18 +24,18 @@ const std::unordered_map<uint32, uint32> second_code = {
};
struct card_data {
uint32 code{};
uint32 alias{};
uint32_t code{};
uint32_t alias{};
uint16_t setcode[SIZE_SETCODE]{};
uint32 type{};
uint32 level{};
uint32 attribute{};
uint32 race{};
int32 attack{};
int32 defense{};
uint32 lscale{};
uint32 rscale{};
uint32 link_marker{};
uint32_t type{};
uint32_t level{};
uint32_t attribute{};
uint32_t race{};
int32_t attack{};
int32_t defense{};
uint32_t lscale{};
uint32_t rscale{};
uint32_t link_marker{};
void clear() {
code = 0;
......@@ -53,7 +53,7 @@ struct card_data {
link_marker = 0;
}
bool is_setcode(uint32 value) const {
bool is_setcode(uint32_t value) const {
uint16_t settype = value & 0x0fff;
uint16_t setsubtype = value & 0xf000;
for (auto& x : setcode) {
......@@ -71,7 +71,7 @@ struct card_data {
return alias && (alias < code + CARD_ARTWORK_VERSIONS_OFFSET) && (code < alias + CARD_ARTWORK_VERSIONS_OFFSET);
}
void set_setcode(uint64 value) {
void set_setcode(uint64_t value) {
int ctr = 0;
while (value) {
if (value & 0xffff) {
......@@ -84,7 +84,7 @@ struct card_data {
setcode[i] = 0;
}
uint32 get_original_code() const {
uint32_t get_original_code() const {
return is_alternative() ? alias : code;
}
};
......
......@@ -10,15 +10,7 @@
#include <stdint.h>
#include <assert.h>
typedef unsigned long long uint64;
typedef unsigned int uint32;
typedef unsigned short uint16;
typedef unsigned char uint8;
typedef unsigned char byte;
typedef long long int64;
typedef int int32;
typedef short int16;
typedef signed char int8;
#define MATCH_ALL(x,y) (((x)&(y))==(y))
#define MATCH_ANY(x,y) ((x)&(y))
......
......@@ -48,7 +48,7 @@ void duel::clear() {
game_field = new field(this);
game_field->temp_card = new_card(0);
}
card* duel::new_card(uint32 code) {
card* duel::new_card(uint32_t code) {
card* pcard = new card(this);
cards.insert(pcard);
if (code != TEMP_CARD_ID)
......@@ -97,11 +97,11 @@ void duel::delete_effect(effect* peffect) {
effects.erase(peffect);
delete peffect;
}
int32 duel::read_buffer(byte* buf) {
int32_t duel::read_buffer(byte* buf) {
auto size = buffer_size();
if (size)
std::memcpy(buf, message_buffer.data(), size);
return (int32)size;
return (int32_t)size;
}
void duel::release_script_group() {
for(auto& pgroup : sgroups) {
......@@ -121,25 +121,25 @@ void duel::restore_assumes() {
void duel::write_buffer(const void* data, int size) {
vector_write_block(message_buffer, data, size);
}
void duel::write_buffer32(uint32 value) {
void duel::write_buffer32(uint32_t value) {
vector_write<uint32_t>(message_buffer, value);
}
void duel::write_buffer16(uint16 value) {
void duel::write_buffer16(uint16_t value) {
vector_write<uint16_t>(message_buffer, value);
}
void duel::write_buffer8(uint8 value) {
void duel::write_buffer8(uint8_t value) {
vector_write<unsigned char>(message_buffer, value);
}
void duel::clear_buffer() {
message_buffer.clear();
}
void duel::set_responsei(uint32 resp) {
void duel::set_responsei(uint32_t resp) {
game_field->returns.ivalue[0] = resp;
}
void duel::set_responseb(byte* resp) {
std::memcpy(game_field->returns.bvalue, resp, SIZE_RETURN_VALUE);
}
int32 duel::get_next_integer(int32 l, int32 h) {
int32_t duel::get_next_integer(int32_t l, int32_t h) {
if (game_field->core.duel_options & DUEL_OLD_REPLAY) {
return random.get_random_integer_old(l, h);
}
......
......@@ -41,10 +41,10 @@ public:
~duel();
void clear();
uint32 buffer_size() const {
return (uint32)message_buffer.size() & PROCESSOR_BUFFER_LEN;
uint32_t buffer_size() const {
return (uint32_t)message_buffer.size() & PROCESSOR_BUFFER_LEN;
}
card* new_card(uint32 code);
card* new_card(uint32_t code);
group* new_group();
group* new_group(card* pcard);
group* new_group(const card_set& cset);
......@@ -54,15 +54,15 @@ public:
void delete_effect(effect* peffect);
void release_script_group();
void restore_assumes();
int32 read_buffer(byte* buf);
int32_t read_buffer(byte* buf);
void write_buffer(const void* data, int size);
void write_buffer32(uint32 value);
void write_buffer16(uint16 value);
void write_buffer8(uint8 value);
void write_buffer32(uint32_t value);
void write_buffer16(uint16_t value);
void write_buffer8(uint8_t value);
void clear_buffer();
void set_responsei(uint32 resp);
void set_responsei(uint32_t resp);
void set_responseb(byte* resp);
int32 get_next_integer(int32 l, int32 h);
int32_t get_next_integer(int32_t l, int32_t h);
private:
group* register_group(group* pgroup);
};
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -27,8 +27,8 @@ public:
duel* pduel;
card_set container;
card_set::iterator it;
int32 ref_handle{ 0 };
uint32 is_readonly{ GTYPE_DEFAULT };
int32_t ref_handle{ 0 };
uint32_t is_readonly{ GTYPE_DEFAULT };
bool is_iterator_dirty{ true };
bool has_card(card* c) {
......
This diff is collapsed.
......@@ -23,7 +23,7 @@ class effect;
class group;
class duel;
enum LuaParamType : int32 {
enum LuaParamType : int32_t {
PARAM_TYPE_INT = 0x01,
PARAM_TYPE_STRING = 0x02,
PARAM_TYPE_CARD = 0x04,
......@@ -38,9 +38,9 @@ class interpreter {
public:
union lua_param {
void* ptr;
int32 integer;
int32_t integer;
};
using coroutine_map = std::unordered_map<int32, std::pair<lua_State*, int32>>;
using coroutine_map = std::unordered_map<int32_t, std::pair<lua_State*, int32_t>>;
using param_list = std::list<std::pair<lua_param, LuaParamType>>;
duel* pduel;
......@@ -50,8 +50,8 @@ public:
param_list params;
param_list resumes;
coroutine_map coroutines;
int32 no_action;
int32 call_depth;
int32_t no_action;
int32_t call_depth;
explicit interpreter(duel* pd);
~interpreter();
......@@ -62,28 +62,28 @@ public:
void register_group(group* pgroup);
void unregister_group(group* pgroup);
int32 load_script(const char* script_name);
int32 load_card_script(uint32 code);
int32_t load_script(const char* script_name);
int32_t load_card_script(uint32_t code);
void add_param(void* param, LuaParamType type, bool front = false);
void add_param(int32 param, LuaParamType type, bool front = false);
void add_param(int32_t param, LuaParamType type, bool front = false);
void push_param(lua_State* L, bool is_coroutine = false);
int32 call_function(int32 f, uint32 param_count, int32 ret_count);
int32 call_card_function(card* pcard, const char* f, uint32 param_count, int32 ret_count);
int32 call_code_function(uint32 code, const char* f, uint32 param_count, int32 ret_count);
int32 check_condition(int32 f, uint32 param_count);
int32 check_filter(lua_State* L, card* pcard, int32 findex, int32 extraargs);
int32 get_operation_value(card* pcard, int32 findex, int32 extraargs);
int32 get_function_value(int32 f, uint32 param_count);
int32 get_function_value(int32 f, uint32 param_count, std::vector<lua_Integer>& result);
int32 call_coroutine(int32 f, uint32 param_count, int32* yield_value, uint16 step);
int32 clone_function_ref(int32 func_ref);
void* get_ref_object(int32 ref_handler);
int32_t call_function(int32_t f, uint32_t param_count, int32_t ret_count);
int32_t call_card_function(card* pcard, const char* f, uint32_t param_count, int32_t ret_count);
int32_t call_code_function(uint32_t code, const char* f, uint32_t param_count, int32_t ret_count);
int32_t check_condition(int32_t f, uint32_t param_count);
int32_t check_filter(lua_State* L, card* pcard, int32_t findex, int32_t extraargs);
int32_t get_operation_value(card* pcard, int32_t findex, int32_t extraargs);
int32_t get_function_value(int32_t f, uint32_t param_count);
int32_t get_function_value(int32_t f, uint32_t param_count, std::vector<lua_Integer>& result);
int32_t call_coroutine(int32_t f, uint32_t param_count, int32_t* yield_value, uint16_t step);
int32_t clone_function_ref(int32_t func_ref);
void* get_ref_object(int32_t ref_handler);
static void card2value(lua_State* L, card* pcard);
static void group2value(lua_State* L, group* pgroup);
static void effect2value(lua_State* L, effect* peffect);
static void function2value(lua_State* L, int32 func_ref);
static int32 get_function_handle(lua_State* L, int32 index);
static void function2value(lua_State* L, int32_t func_ref);
static int32_t get_function_handle(lua_State* L, int32_t index);
static duel* get_duel_info(lua_State* L);
static bool is_load_script(const card_data& data);
......
This diff is collapsed.
......@@ -13,7 +13,7 @@
#include "effect.h"
#include "ocgapi.h"
int32 scriptlib::debug_message(lua_State *L) {
int32_t scriptlib::debug_message(lua_State *L) {
duel* pduel = interpreter::get_duel_info(L);
lua_getglobal(L, "tostring");
lua_pushvalue(L, -2);
......@@ -22,16 +22,16 @@ int32 scriptlib::debug_message(lua_State *L) {
handle_message(pduel, 2);
return 0;
}
int32 scriptlib::debug_add_card(lua_State *L) {
int32_t scriptlib::debug_add_card(lua_State *L) {
check_param_count(L, 6);
duel* pduel = interpreter::get_duel_info(L);
int32 code = (int32)lua_tointeger(L, 1);
int32 owner = (int32)lua_tointeger(L, 2);
int32 playerid = (int32)lua_tointeger(L, 3);
int32 location = (int32)lua_tointeger(L, 4);
int32 sequence = (int32)lua_tointeger(L, 5);
int32 position = (int32)lua_tointeger(L, 6);
int32 proc = lua_toboolean(L, 7);
int32_t code = (int32_t)lua_tointeger(L, 1);
int32_t owner = (int32_t)lua_tointeger(L, 2);
int32_t playerid = (int32_t)lua_tointeger(L, 3);
int32_t location = (int32_t)lua_tointeger(L, 4);
int32_t sequence = (int32_t)lua_tointeger(L, 5);
int32_t position = (int32_t)lua_tointeger(L, 6);
int32_t proc = lua_toboolean(L, 7);
if (!check_playerid(owner))
return 0;
if (!check_playerid(playerid))
......@@ -43,7 +43,7 @@ int32 scriptlib::debug_add_card(lua_State *L) {
position = POS_FACEDOWN_DEFENSE;
pcard->sendto_param.position = position;
if(location == LOCATION_PZONE) {
int32 seq = pduel->game_field->get_pzone_sequence(sequence);
int32_t seq = pduel->game_field->get_pzone_sequence(sequence);
pduel->game_field->add_card(playerid, pcard, LOCATION_SZONE, seq, TRUE);
} else {
pduel->game_field->add_card(playerid, pcard, location, sequence);
......@@ -71,13 +71,13 @@ int32 scriptlib::debug_add_card(lua_State *L) {
}
return 0;
}
int32 scriptlib::debug_set_player_info(lua_State *L) {
int32_t scriptlib::debug_set_player_info(lua_State *L) {
check_param_count(L, 4);
duel* pduel = interpreter::get_duel_info(L);
int32 playerid = (int32)lua_tointeger(L, 1);
int32 lp = (int32)lua_tointeger(L, 2);
int32 startcount = (int32)lua_tointeger(L, 3);
int32 drawcount = (int32)lua_tointeger(L, 4);
int32_t playerid = (int32_t)lua_tointeger(L, 1);
int32_t lp = (int32_t)lua_tointeger(L, 2);
int32_t startcount = (int32_t)lua_tointeger(L, 3);
int32_t drawcount = (int32_t)lua_tointeger(L, 4);
if(playerid != 0 && playerid != 1)
return 0;
pduel->game_field->player[playerid].lp = lp;
......@@ -85,18 +85,18 @@ int32 scriptlib::debug_set_player_info(lua_State *L) {
pduel->game_field->player[playerid].draw_count = drawcount;
return 0;
}
int32 scriptlib::debug_pre_summon(lua_State *L) {
int32_t scriptlib::debug_pre_summon(lua_State *L) {
check_param_count(L, 2);
check_param(L, PARAM_TYPE_CARD, 1);
card* pcard = *(card**) lua_touserdata(L, 1);
uint32 summon_type = (uint32)lua_tointeger(L, 2);
uint8 summon_location = 0;
uint32_t summon_type = (uint32_t)lua_tointeger(L, 2);
uint8_t summon_location = 0;
if(lua_gettop(L) > 2)
summon_location = (uint8)lua_tointeger(L, 3);
summon_location = (uint8_t)lua_tointeger(L, 3);
pcard->summon_info = summon_type | (summon_location << 16);
return 0;
}
int32 scriptlib::debug_pre_equip(lua_State *L) {
int32_t scriptlib::debug_pre_equip(lua_State *L) {
check_param_count(L, 2);
check_param(L, PARAM_TYPE_CARD, 1);
check_param(L, PARAM_TYPE_CARD, 2);
......@@ -114,7 +114,7 @@ int32 scriptlib::debug_pre_equip(lua_State *L) {
}
return 1;
}
int32 scriptlib::debug_pre_set_target(lua_State *L) {
int32_t scriptlib::debug_pre_set_target(lua_State *L) {
check_param_count(L, 2);
check_param(L, PARAM_TYPE_CARD, 1);
check_param(L, PARAM_TYPE_CARD, 2);
......@@ -123,23 +123,23 @@ int32 scriptlib::debug_pre_set_target(lua_State *L) {
t_card->add_card_target(target);
return 0;
}
int32 scriptlib::debug_pre_add_counter(lua_State *L) {
int32_t scriptlib::debug_pre_add_counter(lua_State *L) {
check_param_count(L, 2);
check_param(L, PARAM_TYPE_CARD, 1);
card* pcard = *(card**) lua_touserdata(L, 1);
uint32 countertype = (uint32)lua_tointeger(L, 2);
uint16 count = (uint16)lua_tointeger(L, 3);
uint16 cttype = countertype;
uint32_t countertype = (uint32_t)lua_tointeger(L, 2);
uint16_t count = (uint16_t)lua_tointeger(L, 3);
uint16_t cttype = countertype;
auto pr = pcard->counters.emplace(cttype, 0);
auto cmit = pr.first;
cmit->second += count;
return 0;
}
int32 scriptlib::debug_reload_field_begin(lua_State *L) {
int32_t scriptlib::debug_reload_field_begin(lua_State *L) {
check_param_count(L, 1);
duel* pduel = interpreter::get_duel_info(L);
uint32 flag = (uint32)lua_tointeger(L, 1);
int32 rule = (int32)lua_tointeger(L, 2);
uint32_t flag = (uint32_t)lua_tointeger(L, 1);
int32_t rule = (int32_t)lua_tointeger(L, 2);
pduel->clear();
pduel->game_field->core.duel_options |= flag;
if (rule)
......@@ -154,7 +154,7 @@ int32 scriptlib::debug_reload_field_begin(lua_State *L) {
}
return 0;
}
int32 scriptlib::debug_reload_field_end(lua_State *L) {
int32_t scriptlib::debug_reload_field_end(lua_State *L) {
duel* pduel = interpreter::get_duel_info(L);
pduel->game_field->core.shuffle_hand_check[0] = FALSE;
pduel->game_field->core.shuffle_hand_check[1] = FALSE;
......@@ -163,7 +163,7 @@ int32 scriptlib::debug_reload_field_end(lua_State *L) {
pduel->game_field->reload_field_info();
return 0;
}
int32 scriptlib::debug_set_ai_name(lua_State *L) {
int32_t scriptlib::debug_set_ai_name(lua_State *L) {
check_param_count(L, 1);
check_param(L, PARAM_TYPE_STRING, 1);
duel* pduel = interpreter::get_duel_info(L);
......@@ -177,7 +177,7 @@ int32 scriptlib::debug_set_ai_name(lua_State *L) {
pduel->write_buffer8(0);
return 0;
}
int32 scriptlib::debug_show_hint(lua_State *L) {
int32_t scriptlib::debug_show_hint(lua_State *L) {
check_param_count(L, 1);
check_param(L, PARAM_TYPE_STRING, 1);
duel* pduel = interpreter::get_duel_info(L);
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -28,35 +28,35 @@ class effect;
class interpreter;
typedef byte* (*script_reader)(const char*, int*);
typedef uint32 (*card_reader)(uint32, card_data*);
typedef uint32 (*message_handler)(intptr_t, uint32);
typedef uint32_t (*card_reader)(uint32_t, card_data*);
typedef uint32_t (*message_handler)(intptr_t, uint32_t);
extern "C" DECL_DLLEXPORT void set_script_reader(script_reader f);
extern "C" DECL_DLLEXPORT void set_card_reader(card_reader f);
extern "C" DECL_DLLEXPORT void set_message_handler(message_handler f);
byte* read_script(const char* script_name, int* len);
uint32 read_card(uint32 code, card_data* data);
uint32 handle_message(void* pduel, uint32 message_type);
uint32_t read_card(uint32_t code, card_data* data);
uint32_t handle_message(void* pduel, uint32_t message_type);
extern "C" DECL_DLLEXPORT intptr_t create_duel(uint_fast32_t seed);
extern "C" DECL_DLLEXPORT void start_duel(intptr_t pduel, uint32 options);
extern "C" DECL_DLLEXPORT void start_duel(intptr_t pduel, uint32_t options);
extern "C" DECL_DLLEXPORT void end_duel(intptr_t pduel);
extern "C" DECL_DLLEXPORT void set_player_info(intptr_t pduel, int32 playerid, int32 lp, int32 startcount, int32 drawcount);
extern "C" DECL_DLLEXPORT void set_player_info(intptr_t pduel, int32_t playerid, int32_t lp, int32_t startcount, int32_t drawcount);
extern "C" DECL_DLLEXPORT void get_log_message(intptr_t pduel, char* buf);
extern "C" DECL_DLLEXPORT int32 get_message(intptr_t pduel, byte* buf);
extern "C" DECL_DLLEXPORT uint32 process(intptr_t pduel);
extern "C" DECL_DLLEXPORT void new_card(intptr_t pduel, uint32 code, uint8 owner, uint8 playerid, uint8 location, uint8 sequence, uint8 position);
extern "C" DECL_DLLEXPORT void new_tag_card(intptr_t pduel, uint32 code, uint8 owner, uint8 location);
extern "C" DECL_DLLEXPORT int32 query_card(intptr_t pduel, uint8 playerid, uint8 location, uint8 sequence, int32 query_flag, byte* buf, int32 use_cache);
extern "C" DECL_DLLEXPORT int32 query_field_count(intptr_t pduel, uint8 playerid, uint8 location);
extern "C" DECL_DLLEXPORT int32 query_field_card(intptr_t pduel, uint8 playerid, uint8 location, uint32 query_flag, byte* buf, int32 use_cache);
extern "C" DECL_DLLEXPORT int32 query_field_info(intptr_t pduel, byte* buf);
extern "C" DECL_DLLEXPORT void set_responsei(intptr_t pduel, int32 value);
extern "C" DECL_DLLEXPORT int32_t get_message(intptr_t pduel, byte* buf);
extern "C" DECL_DLLEXPORT uint32_t process(intptr_t pduel);
extern "C" DECL_DLLEXPORT void new_card(intptr_t pduel, uint32_t code, uint8_t owner, uint8_t playerid, uint8_t location, uint8_t sequence, uint8_t position);
extern "C" DECL_DLLEXPORT void new_tag_card(intptr_t pduel, uint32_t code, uint8_t owner, uint8_t location);
extern "C" DECL_DLLEXPORT int32_t query_card(intptr_t pduel, uint8_t playerid, uint8_t location, uint8_t sequence, int32_t query_flag, byte* buf, int32_t use_cache);
extern "C" DECL_DLLEXPORT int32_t query_field_count(intptr_t pduel, uint8_t playerid, uint8_t location);
extern "C" DECL_DLLEXPORT int32_t query_field_card(intptr_t pduel, uint8_t playerid, uint8_t location, uint32_t query_flag, byte* buf, int32_t use_cache);
extern "C" DECL_DLLEXPORT int32_t query_field_info(intptr_t pduel, byte* buf);
extern "C" DECL_DLLEXPORT void set_responsei(intptr_t pduel, int32_t value);
extern "C" DECL_DLLEXPORT void set_responseb(intptr_t pduel, byte* buf);
extern "C" DECL_DLLEXPORT int32 preload_script(intptr_t pduel, const char* script_name);
extern "C" DECL_DLLEXPORT int32_t preload_script(intptr_t pduel, const char* script_name);
byte* default_script_reader(const char* script_name, int* len);
uint32 default_card_reader(uint32 code, card_data* data);
uint32 default_message_handler(intptr_t pduel, uint32 msg_type);
uint32_t default_card_reader(uint32_t code, card_data* data);
uint32_t default_message_handler(intptr_t pduel, uint32_t msg_type);
#endif /* OCGAPI_H_ */
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -7,9 +7,9 @@
#include "scriptlib.h"
#include "duel.h"
static int32 check_data_type(lua_State* L, int32 index, const char* tname) {
static int32_t check_data_type(lua_State* L, int32_t index, const char* tname) {
luaL_checkstack(L, 2, nullptr);
int32 result = FALSE;
int32_t result = FALSE;
if(lua_getmetatable(L, index)) {
lua_getglobal(L, tname);
if(lua_rawequal(L, -1, -2))
......@@ -18,11 +18,11 @@ static int32 check_data_type(lua_State* L, int32 index, const char* tname) {
}
return result;
}
int32 scriptlib::check_param(lua_State* L, int32 param_type, int32 index, int32 retfalse) {
int32_t scriptlib::check_param(lua_State* L, int32_t param_type, int32_t index, int32_t retfalse) {
switch (param_type) {
case PARAM_TYPE_CARD: {
luaL_checkstack(L, 1, nullptr);
int32 result = FALSE;
int32_t result = FALSE;
if(lua_isuserdata(L, index) && lua_getmetatable(L, index)) {
result = check_data_type(L, -1, "Card");
lua_pop(L, 1);
......@@ -70,12 +70,12 @@ int32 scriptlib::check_param(lua_State* L, int32 param_type, int32 index, int32
return FALSE;
}
int32 scriptlib::check_param_count(lua_State* L, int32 count) {
int32_t scriptlib::check_param_count(lua_State* L, int32_t count) {
if (lua_gettop(L) < count)
return luaL_error(L, "%d Parameters are needed.", count);
return TRUE;
}
int32 scriptlib::check_action_permission(lua_State* L) {
int32_t scriptlib::check_action_permission(lua_State* L) {
duel* pduel = interpreter::get_duel_info(L);
if(pduel->lua->no_action)
return luaL_error(L, "Action is not allowed here.");
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment