From 872f7b01a7cde37573ac61feadea763bf809cd02 Mon Sep 17 00:00:00 2001 From: Edoardo Lolletti Date: Fri, 13 Jun 2025 19:43:34 +0200 Subject: [PATCH] Add explicit OCG_DuelCreationStatus values for null rng seed and wrong lua lib --- ocgapi.cpp | 4 ++-- ocgapi_types.h | 4 +++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/ocgapi.cpp b/ocgapi.cpp index 9f9ef7b..5f0d852 100644 --- a/ocgapi.cpp +++ b/ocgapi.cpp @@ -41,14 +41,14 @@ OCGAPI int OCG_CreateDuel(OCG_Duel* out_ocg_duel, const OCG_DuelOptions* options options.payload4 = nullptr; } 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; auto* duelPtr = new (std::nothrow) duel(options, valid_lua_lib); if(duelPtr == nullptr) return OCG_DUEL_CREATION_NOT_CREATED; if(!valid_lua_lib) { delete duelPtr; - return OCG_DUEL_CREATION_NOT_CREATED; + return OCG_DUEL_CREATION_INCOMPATIBLE_LUA_API; } *out_ocg_duel = static_cast(duelPtr); return OCG_DUEL_CREATION_SUCCESS; diff --git a/ocgapi_types.h b/ocgapi_types.h index eea3797..47a35b5 100644 --- a/ocgapi_types.h +++ b/ocgapi_types.h @@ -22,7 +22,9 @@ typedef enum OCG_DuelCreationStatus { OCG_DUEL_CREATION_NO_OUTPUT, OCG_DUEL_CREATION_NOT_CREATED, 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; typedef enum OCG_DuelStatus {