Commit 8b12f244 authored by nanahira's avatar nanahira

fix preload

parent d30a3bff
......@@ -39,6 +39,7 @@ public:
int32 no_action;
int32 call_depth;
int32 disable_action_check;
int32 preloaded;
explicit interpreter(duel* pd);
~interpreter();
......
......@@ -61,7 +61,6 @@ extern "C" DECL_DLLEXPORT ptr create_duel(uint32 seed) {
duel* pduel = new duel();
duel_set.insert(pduel);
pduel->random.reset(seed);
pduel->lua->call_code_function(0, (char*) "PreloadUds", 0, 0);
return (ptr)pduel;
}
extern "C" DECL_DLLEXPORT void start_duel(ptr pduel, int32 options) {
......@@ -137,6 +136,10 @@ extern "C" DECL_DLLEXPORT int32 process(ptr pduel) {
}
extern "C" DECL_DLLEXPORT void new_card(ptr pduel, uint32 code, uint8 owner, uint8 playerid, uint8 location, uint8 sequence, uint8 position) {
duel* ptduel = (duel*)pduel;
if(!ptduel->lua->preloaded) {
ptduel->lua->preloaded = TRUE;
ptduel->lua->call_code_function(0, (char*) "PreloadUds", 0, 0);
}
if(ptduel->game_field->is_location_useable(playerid, location, sequence)) {
card* pcard = ptduel->new_card(code);
pcard->owner = owner;
......
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