reman3/game_re/gh_fix/Erm_fn_v_UpdateLastError.cxx

54 lines
1.7 KiB
C++

// AUTO-GENERATED FILE, MOVE TO 'gh_fix' FOLDER PREVENT OVERWRITING!!!!!
#include <r3/binders/auto.h>
#include <gh_global.h>
#include <spdlog/spdlog.h>
extern "C" {
void r3_noop(void *p_cTxt1, void *p_cTxt2); // 00401100 // r3_noop
tdstLastErrorInfo *Erm_fn_p_stFindstMyLastErrorInfo(
ulong ulChannelId); // 0043e2b0 // Erm_fn_p_stFindstMyLastErrorInfo
// 0043e410
/* Check CpaError.h */
void Erm_fn_v_UpdateLastError(ushort uwStartOfWarningsId, byte ucModuleId,
ulong ulChannelId, ushort uwErrNum,
long lDebugData, uchar ucOpenInfoWindow,
uchar ucStopForDebug, char *szPersonalMsg)
{
tdstLastErrorInfo *ptVar2;
ptVar2 = Erm_fn_p_stFindstMyLastErrorInfo(ulChannelId);
if (ptVar2 == (tdstLastErrorInfo *)0x0) {
throw std::runtime_error(
fmt::format("{} {}", s_Error_in_the_Erm__005bd374,
s_There_is_no_more_Channel_error_t_005bd388));
}
if (ptVar2->lastErr != 0) {
throw std::runtime_error(
fmt::format("{}", s_Strange__The_last_error_was_neve_005bd348));
}
ptVar2->lastErr = uwErrNum;
ptVar2->ucLastFailedModuleId = ucModuleId;
ptVar2->ulChannelId = ulChannelId;
if (uwErrNum < uwStartOfWarningsId) {
if (szPersonalMsg == (char *)0x0) {
throw std::runtime_error(fmt::format(
"Unkown fatal error ({}, module: {})", uwErrNum, ucModuleId));
} else {
throw std::runtime_error(
fmt::format("Unkown fatal error ({}, module: {}, {})", uwErrNum,
ucModuleId, szPersonalMsg));
}
}
if (szPersonalMsg == (char *)0x0) {
return;
} else {
SPDLOG_WARN("Erm_Warn: {}, module: {}, {}", uwErrNum, ucModuleId,
szPersonalMsg);
}
}
}