Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[fixed] Spikes sometimes hiding behind grass #2278

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 4 additions & 6 deletions Entities/Structures/Spikes/Spikes.as
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ void onSetStatic(CBlob@ this, const bool isStatic)
if (!isStatic) return;

this.getSprite().PlaySound("/build_wall2.ogg");
this.getSprite().SetZ(500);
}

//temporary struct used to pass some variables by reference
Expand Down Expand Up @@ -87,7 +88,7 @@ void onTick(CBlob@ this)
Vec2f pos = this.getPosition();
const f32 tilesize = map.tilesize;

if (getNet().isServer() &&
if (isServer() &&
(map.isTileSolid(map.getTile(pos)) || map.rayCastSolid(pos - this.getVelocity(), pos)))
{
this.server_Hit(this, pos, Vec2f(0, -1), 3.0f, Hitters::fall, true);
Expand Down Expand Up @@ -128,7 +129,7 @@ void onTick(CBlob@ this)
onSurface = temp.onSurface;
}

if (!onSurface && getNet().isServer())
if (!onSurface && isServer())
{
this.getCurrentScript().runFlags &= ~Script::tick_blob_in_proximity;
this.getCurrentScript().tickFrequency = 1;
Expand All @@ -145,15 +146,12 @@ void onTick(CBlob@ this)
return;
}

if (getNet().isClient() && !this.hasTag("_frontlayer"))
if (isClient() && !this.hasTag("_frontlayer"))
{
CSprite@ sprite = this.getSprite();
sprite.SetZ(500.0f);

if (sprite !is null)
{
CSpriteLayer@ panel = sprite.addSpriteLayer("panel", sprite.getFilename() , 8, 16, this.getTeamNum(), this.getSkinNum());

if (panel !is null)
{
panel.SetOffset(Vec2f(0, 3));
Expand Down