mirror of
https://github.com/OpenFusionProject/OpenFusion.git
synced 2024-11-16 19:20:05 +00:00
Make skill result size check an assertion
This commit is contained in:
parent
e3c3da87b2
commit
13e71de785
@ -5,8 +5,6 @@
|
||||
#include "Buffs.hpp"
|
||||
#include "Nanos.hpp"
|
||||
|
||||
#include <assert.h>
|
||||
|
||||
using namespace Abilities;
|
||||
|
||||
std::map<int32_t, SkillData> Abilities::SkillTable;
|
||||
|
@ -7,6 +7,7 @@
|
||||
|
||||
#include <map>
|
||||
#include <vector>
|
||||
#include <assert.h>
|
||||
|
||||
constexpr size_t MAX_SKILLRESULT_SIZE = sizeof(sSkillResult_BatteryDrain);
|
||||
|
||||
@ -75,12 +76,9 @@ struct SkillResult {
|
||||
size_t size;
|
||||
uint8_t payload[MAX_SKILLRESULT_SIZE];
|
||||
SkillResult(size_t len, void* dat) {
|
||||
if(len <= MAX_SKILLRESULT_SIZE) {
|
||||
size = len;
|
||||
memcpy(payload, dat, len);
|
||||
} else {
|
||||
size = 0;
|
||||
}
|
||||
assert(len <= MAX_SKILLRESULT_SIZE);
|
||||
size = len;
|
||||
memcpy(payload, dat, len);
|
||||
}
|
||||
SkillResult() {
|
||||
size = 0;
|
||||
|
Loading…
Reference in New Issue
Block a user