From dbdc974c9b242088a2dcb3d445aade0e0180a7f3 Mon Sep 17 00:00:00 2001 From: colgay Date: Fri, 15 Mar 2024 20:13:30 +0800 Subject: [PATCH] Update oo_natives.cpp --- src/oo_natives.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/oo_natives.cpp b/src/oo_natives.cpp index dbf6222..6b43978 100644 --- a/src/oo_natives.cpp +++ b/src/oo_natives.cpp @@ -467,7 +467,7 @@ namespace native size_t to_diff = (to_end == 0) ? var_size : to_end - to_begin; size_t cell_count = util::clamp(from_diff, size_t(0), to_diff); - cell_count = __min(cell_count, var_size); + cell_count = (cell_count < var_size) ? cell_count : var_size; MF_CopyAmxMemory(MF_GetAmxAddr(amx, params[5]) + to_begin, &(*var)[from_begin], cell_count); return (*var)[0]; @@ -532,7 +532,7 @@ namespace native size_t from_diff = (from_end == 0) ? var_size : from_end - from_begin; size_t cell_count = util::clamp(from_diff, 0u, to_diff); - cell_count = __min(cell_count, var_size); + cell_count = (cell_count < var_size) ? cell_count : var_size; for (std::size_t i = 0; i < cell_count; i++) (*var)[to_begin + i] = *(MF_GetAmxAddr(amx, params[5]) + from_begin + i);