fix(drawing/drawing): Remove temporary recorder in outward bow updating code

I'm skeptical if this actually works, and I see no difference with this
removed. If this breaks the topo-navmesh code, it may be a better option
to just disable squeezing through under bends in it.
This commit is contained in:
Mikolaj Wielgus 2025-07-17 12:34:40 +02:00
parent 4d5fc25ae3
commit d6a82d5264
1 changed files with 2 additions and 21 deletions

View File

@ -458,7 +458,7 @@ impl<CW: Clone, Cel: Copy, R: AccessRules> Drawing<CW, Cel, R> {
// when the band is squeezed through under bends the outward bows // when the band is squeezed through under bends the outward bows
// of these bends are excluded from infringement detection to avoid // of these bends are excluded from infringement detection to avoid
// false positives (the code where this exception is made is in // false positives (the code where this exception is made is in
// `.update_this_and_outward_bows_intern(...)`). // `.update_this_and_outward_bows(...)`).
// //
// XXX: Possible problem: What if there could be a collision due // XXX: Possible problem: What if there could be a collision due
// to bend's length being zero? We may or may not want to create an // to bend's length being zero? We may or may not want to create an
@ -695,7 +695,7 @@ impl<CW: Clone, Cel: Copy, R: AccessRules> Drawing<CW, Cel, R> {
#[debug_ensures(self.recording_geometry_with_rtree.graph().node_count() == old(self.recording_geometry_with_rtree.graph().node_count()))] #[debug_ensures(self.recording_geometry_with_rtree.graph().node_count() == old(self.recording_geometry_with_rtree.graph().node_count()))]
#[debug_ensures(self.recording_geometry_with_rtree.graph().edge_count() == old(self.recording_geometry_with_rtree.graph().edge_count()))] #[debug_ensures(self.recording_geometry_with_rtree.graph().edge_count() == old(self.recording_geometry_with_rtree.graph().edge_count()))]
fn update_this_and_outward_bows_intern( fn update_this_and_outward_bows(
&mut self, &mut self,
recorder: &mut DrawingEdit<CW, Cel>, recorder: &mut DrawingEdit<CW, Cel>,
around: LooseBendIndex, around: LooseBendIndex,
@ -775,25 +775,6 @@ impl<CW: Clone, Cel: Copy, R: AccessRules> Drawing<CW, Cel, R> {
Ok(()) Ok(())
} }
#[debug_ensures(self.recording_geometry_with_rtree.graph().node_count() == old(self.recording_geometry_with_rtree.graph().node_count()))]
#[debug_ensures(self.recording_geometry_with_rtree.graph().edge_count() == old(self.recording_geometry_with_rtree.graph().edge_count()))]
fn update_this_and_outward_bows(
&mut self,
recorder: &mut DrawingEdit<CW, Cel>,
around: LooseBendIndex,
) -> Result<(), DrawingException> {
let mut temp_recorder = DrawingEdit::new();
let ret = self.update_this_and_outward_bows_intern(&mut temp_recorder, around);
if ret.is_ok() {
recorder.merge(temp_recorder);
} else {
temp_recorder.reverse_inplace();
self.recording_geometry_with_rtree.apply(&temp_recorder);
}
ret
}
#[debug_ensures(ret.is_ok() -> self.recording_geometry_with_rtree.graph().node_count() == old(self.recording_geometry_with_rtree.graph().node_count() + 4))] #[debug_ensures(ret.is_ok() -> self.recording_geometry_with_rtree.graph().node_count() == old(self.recording_geometry_with_rtree.graph().node_count() + 4))]
#[debug_ensures(ret.is_ok() -> self.recording_geometry_with_rtree.graph().edge_count() >= old(self.recording_geometry_with_rtree.graph().edge_count() + 5))] #[debug_ensures(ret.is_ok() -> self.recording_geometry_with_rtree.graph().edge_count() >= old(self.recording_geometry_with_rtree.graph().edge_count() + 5))]
#[debug_ensures(ret.is_err() -> self.recording_geometry_with_rtree.graph().node_count() == old(self.recording_geometry_with_rtree.graph().node_count()))] #[debug_ensures(ret.is_err() -> self.recording_geometry_with_rtree.graph().node_count() == old(self.recording_geometry_with_rtree.graph().node_count()))]