Fix teleport ability, reverse logic in has tile collision. Also use precise collision checking for tiles. Teleporting distance clamping is now proper (650 range)
This commit is contained in:
+1
-1
@@ -303,7 +303,7 @@ bool Wizard::RightClickAbility(){
|
||||
ACCESS_PLAYER
|
||||
float pointMouseDirection=atan2(game->GetWorldMousePos().y-p.GetPos().y,game->GetWorldMousePos().x-p.GetPos().x);
|
||||
vf2d pointTowardsMouse={cos(pointMouseDirection),sin(pointMouseDirection)};
|
||||
float dist=std::clamp(geom2d::line<float>{p.GetPos(),game->GetWorldMousePos()}.length(),0.f,650.f);
|
||||
float dist=std::clamp(geom2d::line<float>{p.GetPos(),game->GetWorldMousePos()}.length(),0.f,6.5f*24);
|
||||
vf2d teleportPoint=p.GetPos()+pointTowardsMouse*dist;
|
||||
while(dist>0&&game->HasTileCollision(game->GetCurrentLevel(),teleportPoint)){
|
||||
dist--;
|
||||
|
||||
Reference in New Issue
Block a user