Skip to content

Correctly allocate a Gib #187

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -168,3 +168,7 @@ This repository includes launch configurations to automatically build and debug
These launch configurations are accessible via the [Run and Debug](https://code.visualstudio.com/docs/editor/debugging#_run-and-debug-view) view, and provide profiles to build and run the game in Release mode or any of the [3 Debug modes](https://github.com/cortex-command-community/Cortex-Command-Community-Project-Source/wiki/Meson-build-options).

All configurations will run pre-launch tasks to build the game using the supported backend before launching.

## SAST Tools

[PVS-Studio](https://pvs-studio.com/en/pvs-studio/?utm_source=website&utm_medium=github&utm_campaign=open_source) - static analyzer for C, C++, C#, and Java code.
2 changes: 1 addition & 1 deletion Source/Activities/GibEditor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -632,7 +632,7 @@ void GibEditor::StuffEditedGibs(MOSRotating* pEditedObject) {
// Take each proxy object and stuff it into a Gib instance which then gets stuffed into the object to be saved
std::list<MovableObject*>* pProxyGibList = m_pEditorGUI->GetPlacedGibs();
for (std::list<MovableObject*>::iterator gItr = pProxyGibList->begin(); gItr != pProxyGibList->end(); ++gItr) {
Gib* newGib;
Gib* newGib = new Gib();
// Only set the refernce instance directly from the isntanceman. OWNERSHIP IS NOT TRANSFERRED!
newGib->m_GibParticle = dynamic_cast<const MovableObject*>(g_PresetMan.GetEntityPreset((*gItr)->GetClassName(), (*gItr)->GetPresetName(), m_ModuleSpaceID));
if (newGib->m_GibParticle) {
Expand Down