From 63e87b046bbe92d1a82e89463707bedcdf55b416 Mon Sep 17 00:00:00 2001 From: Corwin Date: Mon, 3 Apr 2023 12:06:51 +0100 Subject: [PATCH] correctly initialise before iteration --- agb/src/display/object/unmanaged/object.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/agb/src/display/object/unmanaged/object.rs b/agb/src/display/object/unmanaged/object.rs index c79bf24c..1b7d68cd 100644 --- a/agb/src/display/object/unmanaged/object.rs +++ b/agb/src/display/object/unmanaged/object.rs @@ -82,9 +82,10 @@ impl Drop for OAMIterator<'_> { impl UnmanagedOAM<'_> { pub fn iter(&mut self) -> OAMIterator<'_> { + self.up_to.set(-1); OAMIterator { index: 0, - up_to: &mut self.up_to, + up_to: &self.up_to, } }