Collision boundary teleport fix.
This commit is contained in:
parent
8b17d9bcbd
commit
020c15bcc3
@ -170,7 +170,7 @@ void MemoryAllocator::Update(PixelGameEngine*pge,std::vector<std::unique_ptr<Aud
|
|||||||
}
|
}
|
||||||
|
|
||||||
void MemoryAllocator::Draw(TileTransformedView&game,std::vector<std::unique_ptr<Renderable>>&IMAGES){
|
void MemoryAllocator::Draw(TileTransformedView&game,std::vector<std::unique_ptr<Renderable>>&IMAGES){
|
||||||
if(IsBuilding()){
|
if(IsBuilding()&&!InFogOfWar()){
|
||||||
game.GetPGE()->SetDrawTarget(img.Sprite());
|
game.GetPGE()->SetDrawTarget(img.Sprite());
|
||||||
game.GetPGE()->Clear(BLANK);
|
game.GetPGE()->Clear(BLANK);
|
||||||
Renderable&targetImg=buildTransformUnit->GetImage();
|
Renderable&targetImg=buildTransformUnit->GetImage();
|
||||||
|
@ -885,7 +885,7 @@ void VirusAttack::CollisionChecking(std::shared_ptr<Unit>u,std::shared_ptr<Unit>
|
|||||||
u->SetPos({float(WORLD_SIZE.x*CONSTANT::TILE_SIZE.x),u->GetPos().y});
|
u->SetPos({float(WORLD_SIZE.x*CONSTANT::TILE_SIZE.x),u->GetPos().y});
|
||||||
}
|
}
|
||||||
if(u->GetPos().y<0){
|
if(u->GetPos().y<0){
|
||||||
u->SetPos({u->GetPos().y,0});
|
u->SetPos({u->GetPos().x,0});
|
||||||
}
|
}
|
||||||
if(u->GetPos().y>WORLD_SIZE.y*CONSTANT::TILE_SIZE.y){
|
if(u->GetPos().y>WORLD_SIZE.y*CONSTANT::TILE_SIZE.y){
|
||||||
u->SetPos({u->GetPos().x,float(WORLD_SIZE.y*CONSTANT::TILE_SIZE.y)});
|
u->SetPos({u->GetPos().x,float(WORLD_SIZE.y*CONSTANT::TILE_SIZE.y)});
|
||||||
|
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user