From 4d86a04b876e844e00eb9a1d2d45c66fcb1b4367 Mon Sep 17 00:00:00 2001 From: devZoGok Date: Sun, 20 Oct 2024 14:47:08 +0300 Subject: [PATCH] updating vehicle stats upon reinit --- vehicle.cpp | 5 +++++ vehicle.h | 1 + 2 files changed, 6 insertions(+) diff --git a/vehicle.cpp b/vehicle.cpp index 6a68d11..57fba4e 100644 --- a/vehicle.cpp +++ b/vehicle.cpp @@ -94,6 +94,11 @@ namespace battleship{ garrisonCategory = unitTable["garrisonCategory"]; } + void Vehicle::reinit(){ + Unit::reinit(); + initProperties(); + } + void Vehicle::navigate(float destOffset){ Vector3 hypVec = (pathPoints[0] - pos); float hypAngle = hypVec.norm().getAngleBetween(upVec) - PI / 2; diff --git a/vehicle.h b/vehicle.h index 6794d7b..cff6990 100644 --- a/vehicle.h +++ b/vehicle.h @@ -34,6 +34,7 @@ namespace battleship{ void removePathpoint(int = 0); void removeAllPathpoints(); void select(); + void reinit(); protected: std::vector pathPoints; bool pursuingTarget = false;