mirror of
https://gitlab.com/pamhyr/pamhyr2.git
synced 2026-10-30 03:20:41 +01:00
Scenario: Fix scenario duplicattion.
This commit is contained in:
1 parent
090326b75c
commit
ea7fda6b28
1 file changed
+10
-2
+10
-2
@@ -509,11 +509,19 @@ class Study(SQLModel):
|
||||
self.status.scenario.parent
|
||||
)
|
||||
|
||||
new.set_pos(self.status.scenario.x + 100,
|
||||
self.status.scenario.y + 100)
|
||||
|
||||
new.name = self.status.scenario.name + " (copy)"
|
||||
|
||||
self.river._data_traversal(
|
||||
predicate=lambda obj: obj._owner_scenario == source,
|
||||
execute=lambda obj: obj.set_owner_scenario(),
|
||||
predicate=lambda obj, data: obj._owner_scenario == source,
|
||||
modifier=lambda obj, data: obj.set_owner_scenario(),
|
||||
data={}
|
||||
)
|
||||
|
||||
if switch:
|
||||
self.status.scenario = new
|
||||
|
||||
self.status.set_as_editable()
|
||||
return new
|
||||
Reference in new issue
Block a user