From d71842f0a2af036a3bb3cefeb5f99a2fa0736de3 Mon Sep 17 00:00:00 2001 From: devZoGok Date: Fri, 26 Jan 2024 15:02:38 +0200 Subject: [PATCH] some quick fixes --- Assets/Scripts/GameObjects/Units/unitData.lua | 4 ++-- projectile.cpp | 14 +++++++------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/Assets/Scripts/GameObjects/Units/unitData.lua b/Assets/Scripts/GameObjects/Units/unitData.lua index 50081aa..4cc9115 100644 --- a/Assets/Scripts/GameObjects/Units/unitData.lua +++ b/Assets/Scripts/GameObjects/Units/unitData.lua @@ -363,7 +363,7 @@ units = { projectile = {id = ProjectileId.CRUISE_MISSILE, pos = {x = 0, y = 2.44, z = -3.5}, rot = {w = .707, x = -.707, y = 0, z = 0}} }, }, - unitClass = UnitClass.MISSILE_SUBMARINE, + unitClass = UnitClass.SUBMARINE, unitType = UnitType.UNDERWATER, isVehicle = true, health = 500, @@ -393,7 +393,7 @@ units = { projectile = {id = ProjectileId.TORPEDO, pos = {x = 0, y = -.27, z = 4.6}, rot = {w = 1, x = 0, y = 0, z = 0}} } }, - unitClass = UnitClass.STEALTH_SUBMARINE, + unitClass = UnitClass.SUBMARINE, unitType = UnitType.UNDERWATER, isVehicle = true, health = 500, diff --git a/projectile.cpp b/projectile.cpp index 699e557..9c4c905 100755 --- a/projectile.cpp +++ b/projectile.cpp @@ -39,15 +39,15 @@ namespace battleship{ void Projectile::initProperties(){ GameObject::initProperties(); - sol::table projTable = generateView()[GameObject::getGameObjTableName()]; - rayLength = projTable[id + 1]["rayLength"]; - directHitDamage = projTable[id + 1]["directHitDamage"]; + sol::table projTable = generateView()[GameObject::getGameObjTableName()][id + 1]; + rayLength = projTable["rayLength"]; + directHitDamage = projTable["directHitDamage"]; string explKey = "explosion"; - explosionDamage = projTable[id + 1][explKey]["damage"]; - explosionRadius = projTable[id + 1][explKey]["radius"]; - speed = projTable[id + 1]["speed"]; - rotAngle = projTable[id + 1]["rotAngle"]; + explosionDamage = projTable[explKey]["damage"]; + explosionRadius = projTable[explKey]["radius"]; + speed = projTable["speed"]; + rotAngle = projTable["rotAngle"].get_or(0.0); } void Projectile::initSound(){