changeset 684:c8bb28961d31

ecl_vm: fixes for previous instructions
author Gauvain "GovanifY" Roussel-Tarbouriech <gauvain@govanify.com>
date Fri, 16 Aug 2019 23:53:03 +0200
parents 8c50a7b19425
children 11d7e4d6947a
files src/th06/ecl.rs src/th06/ecl_vm.rs src/th06/enemy.rs
diffstat 3 files changed, 12 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/src/th06/ecl.rs
+++ b/src/th06/ecl.rs
@@ -251,7 +251,7 @@ declare_sub_instructions!{
     87 => fn SetUpcomingLaserId(id: u32),
     88 => fn AlterLaserAngle(id: u32, delta: f32),
     90 => fn RepositionLaser(id: u32, ox: f32, oy: f32, oz: f32),
-    91 => fn LaserSetCompare(u32: id),
+    91 => fn LaserSetCompare(id: u32),
     92 => fn CancelLaser(id: u32),
     93 => fn SetSpellcard(face: i16, number: i16, name: String),
     94 => fn Endspellcard(),
--- a/src/th06/ecl_vm.rs
+++ b/src/th06/ecl_vm.rs
@@ -612,14 +612,15 @@ impl EclRunner {
             }
 
             // 88
-            
+            /* 
             SubInstruction::AlterLaserAngle(laser_id, delta) => {
                 let mut enemy = self.enemy.borrow_mut();
                 if enemy.laser_by_id.contains_key(&laser_id) {
-                    let mut laser = enemy.laser_by_id.get(laser_id);
+                    let mut laser = enemy.laser_by_id.get(&laser_id);
                     laser.angle += self.get_f32(delta);
                 }
             }
+            */
             
             // 89
             /*
@@ -634,13 +635,15 @@ impl EclRunner {
             */
 
             // 90
+            /*
             SubInstruction::RepositionLaser(laser_id, ox, oy, oz) => {
                 let mut enemy = self.enemy.borrow_mut();
                 if enemy.laser_by_id.contains_key(&laser_id) {
-                    let mut laser = enemy.laser_by_id.get(laser_id);
+                    let mut laser = enemy.laser_by_id.get(&laser_id);
                     laser.set_base_pos(enemy.pos.x + ox, enemy.pos.y + oy, enemy.z + oz)
                 }
             }
+            */
             // 91
             // wat
             SubInstruction::LaserSetCompare(laser_id) => {
--- a/src/th06/enemy.rs
+++ b/src/th06/enemy.rs
@@ -51,7 +51,11 @@ impl std::ops::Add<Offset> for Position 
 struct Callback;
 
 #[derive(Debug, Clone)]
-struct Laser;
+/// XXX
+pub struct Laser {
+    /// XXX
+    pub placeholder: u32
+}
 
 #[derive(Debug, Clone, Default)]
 struct Process;