mirror of
https://github.com/edo9300/ygopro-core
synced 2026-08-25 16:23:07 -04:00
Add explicit OCG_DuelCreationStatus values for null rng seed and wrong lua lib
This commit is contained in:
parent
a5e62fb65e
commit
872f7b01a7
2 changed files with 5 additions and 3 deletions
|
|
@ -41,14 +41,14 @@ OCGAPI int OCG_CreateDuel(OCG_Duel* out_ocg_duel, const OCG_DuelOptions* options
|
||||||
options.payload4 = nullptr;
|
options.payload4 = nullptr;
|
||||||
}
|
}
|
||||||
if(options.seed[0] == 0 && options.seed[1] == 0 && options.seed[2] == 0 && options.seed[3] == 0)
|
if(options.seed[0] == 0 && options.seed[1] == 0 && options.seed[2] == 0 && options.seed[3] == 0)
|
||||||
return OCG_DUEL_CREATION_NOT_CREATED;
|
return OCG_DUEL_CREATION_NULL_RNG_SEED;
|
||||||
bool valid_lua_lib = true;
|
bool valid_lua_lib = true;
|
||||||
auto* duelPtr = new (std::nothrow) duel(options, valid_lua_lib);
|
auto* duelPtr = new (std::nothrow) duel(options, valid_lua_lib);
|
||||||
if(duelPtr == nullptr)
|
if(duelPtr == nullptr)
|
||||||
return OCG_DUEL_CREATION_NOT_CREATED;
|
return OCG_DUEL_CREATION_NOT_CREATED;
|
||||||
if(!valid_lua_lib) {
|
if(!valid_lua_lib) {
|
||||||
delete duelPtr;
|
delete duelPtr;
|
||||||
return OCG_DUEL_CREATION_NOT_CREATED;
|
return OCG_DUEL_CREATION_INCOMPATIBLE_LUA_API;
|
||||||
}
|
}
|
||||||
*out_ocg_duel = static_cast<OCG_Duel>(duelPtr);
|
*out_ocg_duel = static_cast<OCG_Duel>(duelPtr);
|
||||||
return OCG_DUEL_CREATION_SUCCESS;
|
return OCG_DUEL_CREATION_SUCCESS;
|
||||||
|
|
|
||||||
|
|
@ -22,7 +22,9 @@ typedef enum OCG_DuelCreationStatus {
|
||||||
OCG_DUEL_CREATION_NO_OUTPUT,
|
OCG_DUEL_CREATION_NO_OUTPUT,
|
||||||
OCG_DUEL_CREATION_NOT_CREATED,
|
OCG_DUEL_CREATION_NOT_CREATED,
|
||||||
OCG_DUEL_CREATION_NULL_DATA_READER,
|
OCG_DUEL_CREATION_NULL_DATA_READER,
|
||||||
OCG_DUEL_CREATION_NULL_SCRIPT_READER
|
OCG_DUEL_CREATION_NULL_SCRIPT_READER,
|
||||||
|
OCG_DUEL_CREATION_INCOMPATIBLE_LUA_API,
|
||||||
|
OCG_DUEL_CREATION_NULL_RNG_SEED
|
||||||
}OCG_DuelCreationStatus;
|
}OCG_DuelCreationStatus;
|
||||||
|
|
||||||
typedef enum OCG_DuelStatus {
|
typedef enum OCG_DuelStatus {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue