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

add slides #6

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion src/game/client/components/mapimages.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ static bool IsValidTile(int LayerType, bool EntitiesAreMasked, EMapImageModType

if(EntitiesModType == MAP_IMAGE_MOD_TYPE_DDNET || EntitiesModType == MAP_IMAGE_MOD_TYPE_DDRACE)
{
if(EntitiesModType == MAP_IMAGE_MOD_TYPE_DDNET || TileIndex != TILE_SPEED_BOOST_OLD || TileIndex != TILE_SPEED_BOOST)
if(EntitiesModType == MAP_IMAGE_MOD_TYPE_DDNET || TileIndex != TILE_SPEED_BOOST_OLD || TileIndex != TILE_SPEED_BOOST || TileIndex != TILE_SPEED_SLIDE)
{
if(LayerType == MAP_IMAGE_ENTITY_LAYER_TYPE_ALL_EXCEPT_SWITCH &&
!IsValidGameTile(TileIndex) &&
Expand Down
10 changes: 10 additions & 0 deletions src/game/client/prediction/entities/character.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -716,6 +716,16 @@ void CCharacter::HandleSkippableTiles(int Index)
}
m_Core.m_Vel = ClampVel(m_MoveRestrictions, TempVel);
}
else if(Type == TILE_SPEED_SLIDE)
{
TempVel = ClampVel(m_MoveRestrictions, TempVel);
float CurrentDirectionalSpeed = dot(Direction, TempVel);
if(CurrentDirectionalSpeed >= 0)
{
TempVel += Direction * -CurrentDirectionalSpeed;
}
m_Core.m_Vel = ClampVel(m_MoveRestrictions, TempVel);
}
}
}

Expand Down
4 changes: 3 additions & 1 deletion src/game/editor/explanations.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -151,9 +151,11 @@ const char *CEditor::ExplainDDNet(int Tile, int Layer)
if(Layer == LAYER_TELE)
return "CHECKPOINT TELEPORT TO: Tees will appear here after touching TELEPORT CHECKPOINT with the same number and falling into CFROM TELEPORT.";
break;
case TILE_TELECHECKIN:
case TILE_TELECHECKIN: // also TILE_SPEED_SLIDE
if(Layer == LAYER_TELE)
return "BLUE CHECKPOINT TELEPORT: Sends tees to CTO with the same number as the last touched TELEPORT CHECKPOINT. Speed and hook are kept.";
if(Layer == LAYER_SPEEDUP)
return "SLIDE: Allows the Tee to slide, can be angled.";
break;
case TILE_REFILL_JUMPS:
if(Layer == LAYER_GAME || Layer == LAYER_FRONT)
Expand Down
2 changes: 1 addition & 1 deletion src/game/mapitems.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ bool IsTeleTileNumberUsedAny(int Index)

bool IsValidSpeedupTile(int Index)
{
return Index == TILE_SPEED_BOOST_OLD || Index == TILE_SPEED_BOOST;
return Index == TILE_SPEED_BOOST_OLD || Index == TILE_SPEED_BOOST || Index == TILE_SPEED_SLIDE;
}

bool IsValidSwitchTile(int Index)
Expand Down
1 change: 1 addition & 0 deletions src/game/mapitems.h
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ enum
TILE_TELEOUT,
TILE_SPEED_BOOST_OLD = 28,
TILE_SPEED_BOOST,
TILE_SPEED_SLIDE = 31,
TILE_TELECHECK = 29,
TILE_TELECHECKOUT,
TILE_TELECHECKIN,
Expand Down
10 changes: 10 additions & 0 deletions src/game/server/entities/character.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1492,6 +1492,16 @@ void CCharacter::HandleSkippableTiles(int Index)
}
m_Core.m_Vel = ClampVel(m_MoveRestrictions, TempVel);
}
else if(Type == TILE_SPEED_SLIDE)
{
TempVel = ClampVel(m_MoveRestrictions, TempVel);
float CurrentDirectionalSpeed = dot(Direction, TempVel);
if(CurrentDirectionalSpeed >= 0)
{
TempVel += Direction * -CurrentDirectionalSpeed;
}
m_Core.m_Vel = ClampVel(m_MoveRestrictions, TempVel);
}
}
}

Expand Down
Loading