File tree Expand file tree Collapse file tree 3 files changed +7
-8
lines changed Expand file tree Collapse file tree 3 files changed +7
-8
lines changed Original file line number Diff line number Diff line change @@ -559,12 +559,12 @@ void GAScripted::AddPieSlicesToActiveActorPieMenus() {
559
559
PieMenu *controlledActorPieMenu = m_ControlledActor[player]->GetPieMenu ();
560
560
if (controlledActorPieMenu && m_ControlledActor[player]->GetController ()->IsState (PIE_MENU_ACTIVE) && controlledActorPieMenu->IsEnabling ()) {
561
561
for (const std::unique_ptr<PieSlice> &pieSlice : m_PieSlicesToAdd) {
562
- controlledActorPieMenu->AddPieSliceIfPresetNameIsUnique (dynamic_cast <PieSlice *>( pieSlice-> Clone () ), this , true );
562
+ controlledActorPieMenu->AddPieSliceIfPresetNameIsUnique (pieSlice. get ( ), this , true );
563
563
}
564
564
for (const GlobalScript *globalScript : m_GlobalScriptsList) {
565
565
if (globalScript->IsActive ()) {
566
566
for (const std::unique_ptr<PieSlice> &pieSlice : globalScript->GetPieSlicesToAdd ()) {
567
- controlledActorPieMenu->AddPieSliceIfPresetNameIsUnique (dynamic_cast <PieSlice *>( pieSlice-> Clone () ), globalScript, true );
567
+ controlledActorPieMenu->AddPieSliceIfPresetNameIsUnique (pieSlice. get ( ), globalScript, true );
568
568
}
569
569
}
570
570
}
Original file line number Diff line number Diff line change @@ -378,7 +378,7 @@ namespace RTE {
378
378
const std::string &pieSlicePresetName = pieSliceToAdd->GetPresetName ();
379
379
380
380
if (pieSlicePresetName == " None" ) {
381
- return AddPieSlice (pieSliceToAdd, pieSliceOriginalSource, allowQuadrantOverflow);
381
+ return AddPieSlice (dynamic_cast <PieSlice*>( pieSliceToAdd-> Clone ()) , pieSliceOriginalSource, allowQuadrantOverflow);
382
382
}
383
383
384
384
bool pieSliceAlreadyExists = onlyCheckPieSlicesWithSameOriginalSource ? false : GetFirstPieSliceByPresetName (pieSlicePresetName) != nullptr ;
@@ -392,11 +392,10 @@ namespace RTE {
392
392
}
393
393
394
394
if (pieSliceAlreadyExists) {
395
- delete pieSliceToAdd;
396
395
return false ;
397
396
}
398
397
399
- return AddPieSlice (pieSliceToAdd, pieSliceOriginalSource, allowQuadrantOverflow);
398
+ return AddPieSlice (dynamic_cast <PieSlice*>( pieSliceToAdd-> Clone ()) , pieSliceOriginalSource, allowQuadrantOverflow);
400
399
}
401
400
402
401
// ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
Original file line number Diff line number Diff line change @@ -1210,9 +1210,9 @@ namespace RTE {
1210
1210
.def (" GetFirstPieSliceByType" , &PieMenu::GetFirstPieSliceByType)
1211
1211
.def (" AddPieSlice" , &PieMenu::AddPieSlice, luabind::adopt (_2))
1212
1212
.def (" AddPieSlice" , &LuaAdaptersPieMenu::AddPieSlice, luabind::adopt (_2))
1213
- .def (" AddPieSliceIfPresetNameIsUnique" , &PieMenu::AddPieSliceIfPresetNameIsUnique, luabind::adopt (_2) )
1214
- .def (" AddPieSliceIfPresetNameIsUnique" , &LuaAdaptersPieMenu::AddPieSliceIfPresetNameIsUnique1, luabind::adopt (_2) )
1215
- .def (" AddPieSliceIfPresetNameIsUnique" , &LuaAdaptersPieMenu::AddPieSliceIfPresetNameIsUnique2, luabind::adopt (_2) )
1213
+ .def (" AddPieSliceIfPresetNameIsUnique" , &PieMenu::AddPieSliceIfPresetNameIsUnique)
1214
+ .def (" AddPieSliceIfPresetNameIsUnique" , &LuaAdaptersPieMenu::AddPieSliceIfPresetNameIsUnique1)
1215
+ .def (" AddPieSliceIfPresetNameIsUnique" , &LuaAdaptersPieMenu::AddPieSliceIfPresetNameIsUnique2)
1216
1216
.def (" RemovePieSlice" , &PieMenu::RemovePieSlice, luabind::adopt (luabind::return_value))
1217
1217
.def (" RemovePieSlicesByPresetName" , &PieMenu::RemovePieSlicesByPresetName)
1218
1218
.def (" RemovePieSlicesByType" , &PieMenu::RemovePieSlicesByType)
You can’t perform that action at this time.
0 commit comments