aboutsummaryrefslogtreecommitdiff
path: root/entities
diff options
context:
space:
mode:
authorApickx <apickx@cogarr.com>2018-03-08 20:15:37 -0500
committerApickx <apickx@cogarr.com>2018-03-08 20:15:37 -0500
commit4f48a4ec5f7a92857f518bba67deb52ab0ced988 (patch)
treec640043c18db82e0a1392d5f4e0a6123857e5549 /entities
parent9722802672a6edba9f7dd8f6a435a02284691925 (diff)
downloadwintersurvival2-4f48a4ec5f7a92857f518bba67deb52ab0ced988.tar.gz
wintersurvival2-4f48a4ec5f7a92857f518bba67deb52ab0ced988.tar.bz2
wintersurvival2-4f48a4ec5f7a92857f518bba67deb52ab0ced988.zip
Fixed fireball
Fixed a bug with fireball spell, and projectile entity
Diffstat (limited to 'entities')
-rw-r--r--entities/entities/ws_projectile/init.lua11
1 files changed, 8 insertions, 3 deletions
diff --git a/entities/entities/ws_projectile/init.lua b/entities/entities/ws_projectile/init.lua
index 0a18b1a..f47c75f 100644
--- a/entities/entities/ws_projectile/init.lua
+++ b/entities/entities/ws_projectile/init.lua
@@ -10,15 +10,18 @@ function ENT:Initialize()
else self:SetModel("models/mixerman3d/other/arrow.mdl")
end
- if self.init then self:init(self)
- --if(self.speed) then print(self.speed)
+ if self.init then self:init(self) end
+
+ if(self.speed) then print(self.speed)
else print("No speed for projectile!") end
self:PhysicsInit(SOLID_VPHYSICS)
self:SetMoveType(MOVETYPE_VPHYSICS)
self:SetSolid(SOLID_VPHYSICS)
- self:SetCollisionGroup(COLLISION_GROUP_INTERACTIVE)
+ -- self:SetCollisionGroup(COLLISION_GROUP_INTERACTIVE)
self:PhysWake()
+ local po = self:GetPhysicsObject()
+ po:AddVelocity(self:GetForward() * self.speed * po:GetMass())
util.SpriteTrail( self, 0, Ab, true, 1, 0, 1, 1, "sprites/smoke_trail.vmt" )
end
@@ -27,5 +30,7 @@ end
function ENT:Think()
--print("speed is " .. self.speed)
+ local po = self:GetPhysicsObject()
+ po:AddVelocity(self:GetForward() * self.speed * po:GetMass())
self:GetPhysicsObject():SetAngles(self:GetVelocity():Angle())
end