CScriptRelay: Brace conditionals where applicable

This commit is contained in:
Lioncash 2020-05-07 12:33:25 -04:00
parent 1315189990
commit 7145917e30
1 changed files with 7 additions and 4 deletions

View File

@ -16,8 +16,9 @@ void CScriptRelay::AcceptScriptMsg(EScriptObjectMessage msg, TUniqueId objId, CS
if (msg == EScriptObjectMessage::Deleted) { if (msg == EScriptObjectMessage::Deleted) {
UpdateObjectRef(stateMgr); UpdateObjectRef(stateMgr);
} else if (msg == EScriptObjectMessage::SetToZero) { } else if (msg == EScriptObjectMessage::SetToZero) {
if (!x30_24_active) if (!x30_24_active) {
return; return;
}
x38_sendCount++; x38_sendCount++;
TUniqueId tmp = stateMgr.GetLastRelayId(); TUniqueId tmp = stateMgr.GetLastRelayId();
@ -39,8 +40,9 @@ void CScriptRelay::AcceptScriptMsg(EScriptObjectMessage msg, TUniqueId objId, CS
} }
void CScriptRelay::Think(float, CStateManager& stateMgr) { void CScriptRelay::Think(float, CStateManager& stateMgr) {
if (x38_sendCount == 0) if (x38_sendCount == 0) {
return; return;
}
while (x38_sendCount != 0) { while (x38_sendCount != 0) {
x38_sendCount--; x38_sendCount--;
@ -56,9 +58,10 @@ void CScriptRelay::UpdateObjectRef(CStateManager& stateMgr) {
*tmp = x34_nextRelay; *tmp = x34_nextRelay;
return; return;
} }
CScriptRelay* obj = static_cast<CScriptRelay*>(stateMgr.ObjectById(*tmp)); auto* obj = static_cast<CScriptRelay*>(stateMgr.ObjectById(*tmp));
if (obj == nullptr) if (obj == nullptr) {
return; return;
}
tmp = &obj->x34_nextRelay; tmp = &obj->x34_nextRelay;
} }
} }