mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-16 15:40:45 +01:00
Core/Scripts: Fix possible NULL dereferences
Fix possible NULL dereferences probably caused by a typo.
This commit is contained in:
@@ -499,7 +499,7 @@ void Map::ScriptsProcess()
|
||||
if (step.script->FlagToggle.FieldID <= OBJECT_FIELD_ENTRY || step.script->FlagToggle.FieldID >= cSource->GetValuesCount())
|
||||
TC_LOG_ERROR("scripts", "%s wrong field %u (max count: %u) in object (TypeId: %u, Entry: %u, GUID: %u) specified, skipping.",
|
||||
step.script->GetDebugInfo().c_str(), step.script->FlagToggle.FieldID,
|
||||
source->GetValuesCount(), source->GetTypeId(), source->GetEntry(), source->GetGUIDLow());
|
||||
cSource->GetValuesCount(), cSource->GetTypeId(), cSource->GetEntry(), cSource->GetGUIDLow());
|
||||
else
|
||||
cSource->SetFlag(step.script->FlagToggle.FieldID, step.script->FlagToggle.FieldValue);
|
||||
}
|
||||
@@ -513,7 +513,7 @@ void Map::ScriptsProcess()
|
||||
if (step.script->FlagToggle.FieldID <= OBJECT_FIELD_ENTRY || step.script->FlagToggle.FieldID >= cSource->GetValuesCount())
|
||||
TC_LOG_ERROR("scripts", "%s wrong field %u (max count: %u) in object (TypeId: %u, Entry: %u, GUID: %u) specified, skipping.",
|
||||
step.script->GetDebugInfo().c_str(), step.script->FlagToggle.FieldID,
|
||||
source->GetValuesCount(), source->GetTypeId(), source->GetEntry(), source->GetGUIDLow());
|
||||
cSource->GetValuesCount(), cSource->GetTypeId(), cSource->GetEntry(), cSource->GetGUIDLow());
|
||||
else
|
||||
cSource->RemoveFlag(step.script->FlagToggle.FieldID, step.script->FlagToggle.FieldValue);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user