Merge branch 'master' into demo_render2

This commit is contained in:
Sirius 2019-10-31 22:08:49 +08:00 committed by GitHub
commit 45263ebdd0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
30 changed files with 145 additions and 77 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 262 B

After

Width:  |  Height:  |  Size: 1.4 KiB

View file

@ -270,7 +270,7 @@ set_demobuttons = SpriteSet("demobuttons", image_demobuttons, 5, 1)
set_fileicons = SpriteSet("fileicons", image_fileicons, 8, 1)
set_guibuttons = SpriteSet("guibuttons", image_guibuttons, 12, 4)
set_guiicons = SpriteSet("guiicons", image_guiicons, 8, 2)
set_demobuttons2 = SpriteSet("demobuttons2", image_demobuttons2, 3, 1)
set_demobuttons2 = SpriteSet("demobuttons2", image_demobuttons2, 4, 1)
set_audio_source = SpriteSet("audio_source", image_audio_source, 1, 1)
container.spritesets.Add(set_particles)
@ -408,6 +408,8 @@ container.sprites.Add(Sprite("demobutton_faster", set_demobuttons, 4,0,1,1))
container.sprites.Add(Sprite("demobutton_slice_begin", set_demobuttons2, 0,0,1,1))
container.sprites.Add(Sprite("demobutton_slice_end", set_demobuttons2, 1,0,1,1))
container.sprites.Add(Sprite("demobutton_shortcuts_enabled", set_demobuttons2, 2,0,1,1))
container.sprites.Add(Sprite("demobutton_shortcuts_disabled", set_demobuttons2, 3,0,1,1))
container.sprites.Add(Sprite("file_demo1", set_fileicons, 0,0,1,1))
container.sprites.Add(Sprite("file_demo2", set_fileicons, 1,0,1,1))

@ -1 +1 @@
Subproject commit 5ea046d7e709e56bb4bbfef69681cb1b57e304e0
Subproject commit 4694e92c8340002f5c5cc168084a343b673ecbf9

View file

@ -19,13 +19,13 @@
Class NSAutoreleasePoolClass = (Class) objc_getClass("NSAutoreleasePool");
m_Pool = class_createInstance(NSAutoreleasePoolClass, 0);
SEL selector = sel_registerName("init");
objc_msgSend(m_Pool, selector);
((id (*)(id, SEL))objc_msgSend)(m_Pool, selector);
}
~CAutoreleasePool()
{
SEL selector = sel_registerName("drain");
objc_msgSend(m_Pool, selector);
((id (*)(id, SEL))objc_msgSend)(m_Pool, selector);
}
};
#endif

View file

@ -1192,9 +1192,17 @@ int CClient::PlayerScoreNameComp(const void *a, const void *b)
return -1;
if(!p0->m_Player && p1->m_Player)
return 1;
if(p0->m_Score > p1->m_Score)
int Score0 = p0->m_Score;
int Score1 = p1->m_Score;
if(Score0 == -9999)
Score0 = INT_MIN;
if(Score1 == -9999)
Score1 = INT_MIN;
if(Score0 > Score1)
return -1;
if(p0->m_Score < p1->m_Score)
if(Score0 < Score1)
return 1;
return str_comp_nocase(p0->m_aName, p1->m_aName);
}

View file

@ -333,22 +333,19 @@ int CServerBrowser::SortHash() const
void SetFilteredPlayers(const CServerInfo &Item)
{
Item.m_NumFilteredPlayers = 0;
for(int i = 0; i < MAX_CLIENTS; i++)
if (g_Config.m_BrFilterSpectators)
Item.m_NumFilteredPlayers = Item.m_NumPlayers;
else
Item.m_NumFilteredPlayers = Item.m_NumClients;
if (g_Config.m_BrFilterConnectingPlayers)
{
const CServerInfo::CClient &Client = Item.m_aClients[i];
for (int i = 0; i < MAX_CLIENTS; i++)
{
const CServerInfo::CClient &Client = Item.m_aClients[i];
if(Client.m_aName[0] == '\0')
continue;
if(g_Config.m_BrFilterSpectators && !Client.m_Player)
continue;
if(g_Config.m_BrFilterConnectingPlayers && str_comp(Client.m_aName, "(connecting)") == 0 && Client.m_aClan[0] == '\0' && Client.m_Country == -1 && Client.m_Score == 0)
continue;
Item.m_NumFilteredPlayers++;
if (str_comp(Client.m_aName, "(connecting)") == 0 && Client.m_aClan[0] == '\0' && Client.m_Country == -1 && Client.m_Score == 0)
Item.m_NumFilteredPlayers--;
}
}
}

View file

@ -273,7 +273,7 @@ MACRO_CONFIG_INT(ClRaceGhost, cl_race_ghost, 1, 0, 1, CFGFLAG_CLIENT|CFGFLAG_SAV
MACRO_CONFIG_INT(ClRaceGhostServerControl, cl_race_ghost_server_control, 1, 0, 1, CFGFLAG_CLIENT|CFGFLAG_SAVE, "Let the server start the ghost")
MACRO_CONFIG_INT(ClRaceShowGhost, cl_race_show_ghost, 1, 0, 1, CFGFLAG_CLIENT|CFGFLAG_SAVE, "Show ghost")
MACRO_CONFIG_INT(ClRaceSaveGhost, cl_race_save_ghost, 1, 0, 1, CFGFLAG_CLIENT|CFGFLAG_SAVE, "Save ghost")
MACRO_CONFIG_INT(ClDDRaceScoreBoard, cl_ddrace_scoreboard, 1, 0, 1, CFGFLAG_SAVE|CFGFLAG_CLIENT, "Enable DDRace Scoreboard ")
MACRO_CONFIG_INT(ClDDRaceScoreBoard, cl_ddrace_scoreboard, 1, 0, 1, CFGFLAG_SAVE|CFGFLAG_CLIENT, "Enable DDRace Scoreboard")
MACRO_CONFIG_INT(ClShowDecisecs, cl_show_decisecs, 1, 0, 1, CFGFLAG_SAVE|CFGFLAG_CLIENT, "Show deciseconds in game time")
MACRO_CONFIG_INT(SvResetPickups, sv_reset_pickups, 0, 0, 1, CFGFLAG_SERVER|CFGFLAG_GAME, "Whether the weapons are reset on passing the start tile or not")
MACRO_CONFIG_INT(ClShowOthers, cl_show_others, 0, 0, 1, CFGFLAG_CLIENT|CFGFLAG_SAVE, "Show players in other teams")
@ -358,6 +358,7 @@ MACRO_CONFIG_INT(ClConfigVersion, cl_config_version, 0, 0, 0, CFGFLAG_CLIENT|CFG
MACRO_CONFIG_INT(ClDemoSliceBegin, cl_demo_slice_begin, -1, 0, 0, CFGFLAG_SAVE|CFGFLAG_CLIENT, "Begin marker for demo slice")
MACRO_CONFIG_INT(ClDemoSliceEnd, cl_demo_slice_end, -1, 0, 0, CFGFLAG_SAVE|CFGFLAG_CLIENT, "End marker for demo slice")
MACRO_CONFIG_INT(ClDemoShowSpeed, cl_demo_show_speed, 0, 0, 1, CFGFLAG_SAVE|CFGFLAG_CLIENT, "Show speed meter on change")
MACRO_CONFIG_INT(ClDemoKeyboardShortcuts, cl_demo_keyboard_shortcuts, 1, 0, 1, CFGFLAG_SAVE|CFGFLAG_CLIENT, "Enable keyboard shortcuts in demo player")
//opengl
MACRO_CONFIG_INT(GfxOpenGL3, gfx_opengl3, 0, 0, 1, CFGFLAG_SAVE|CFGFLAG_CLIENT, "Use new OpenGL3 with shaders")

View file

@ -93,14 +93,15 @@ void CCamera::OnReset()
{
m_Zoom = 1.0f;
for (int i = g_Config.m_ClDefaultZoom; i < 10; i++)
if(g_Config.m_ClDefaultZoom < 10)
{
m_Zoom *= 1/ZoomStep;
m_Zoom = pow(1/ZoomStep, 10 - g_Config.m_ClDefaultZoom);
}
for (int i = g_Config.m_ClDefaultZoom; i > 10; i--)
else if(g_Config.m_ClDefaultZoom > 10)
{
m_Zoom *= ZoomStep;
m_Zoom = pow(ZoomStep, g_Config.m_ClDefaultZoom - 10);
}
}
void CCamera::ConZoomPlus(IConsole::IResult *pResult, void *pUserData)

View file

@ -101,8 +101,8 @@ void CMapLayers::EnvelopeEval(float TimeOffset, int Env, float *pChannels, void
else
{
s_Time = mix(pThis->m_LastLocalTick / (float)pThis->Client()->GameTickSpeed(),
pThis->m_CurrentLocalTick / (float)pThis->Client()->GameTickSpeed(),
pThis->Client()->IntraGameTick());
pThis->m_CurrentLocalTick / (float)pThis->Client()->GameTickSpeed(),
pThis->Client()->IntraGameTick());
}
}
pThis->RenderTools()->RenderEvalEnvelope(pPoints+pItem->m_StartPoint, pItem->m_NumPoints, 4, s_Time+TimeOffset, pChannels);

View file

@ -164,7 +164,7 @@ void CMenus::RenderDemoPlayer(CUIRect MainView)
}
// handle keyboard shortcuts independent of active menu
if(m_pClient->m_pGameConsole->IsClosed() && m_DemoPlayerState == DEMOPLAYER_NONE)
if(m_pClient->m_pGameConsole->IsClosed() && m_DemoPlayerState == DEMOPLAYER_NONE && g_Config.m_ClDemoKeyboardShortcuts)
{
// increase/decrease speed
if(Input()->KeyPress(KEY_MOUSE_WHEEL_UP) || Input()->KeyPress(KEY_UP))
@ -467,6 +467,16 @@ void CMenus::RenderDemoPlayer(CUIRect MainView)
DemolistOnUpdate(false);
}
// toggle keyboard shortcuts button
ButtonBar.VSplitRight(Margins*3, &ButtonBar, 0);
ButtonBar.VSplitRight(ButtonbarHeight, &ButtonBar, &Button);
static int s_KeyboardShortcutsButton = 0;
int Sprite = g_Config.m_ClDemoKeyboardShortcuts ? SPRITE_DEMOBUTTON_SHORTCUTS_ENABLED : SPRITE_DEMOBUTTON_SHORTCUTS_DISABLED;
if(DoButton_Sprite(&s_KeyboardShortcutsButton, IMAGE_DEMOBUTTONS2, Sprite, 0, &Button, CUI::CORNER_ALL))
{
g_Config.m_ClDemoKeyboardShortcuts ^= 1;
}
// demo name
char aDemoName[64] = {0};
DemoPlayer()->GetDemoName(aDemoName, sizeof(aDemoName));

View file

@ -2078,6 +2078,22 @@ void CMenus::RenderSettingsDDNet(CUIRect MainView)
g_Config.m_ClOverlayEntities = (int)(DoScrollbarH(&g_Config.m_ClOverlayEntities, &Button, g_Config.m_ClOverlayEntities/100.0f)*100.0f);
}
{
CUIRect Button, Label;
Left.HSplitTop(20.0f, &Button, &Left);
Button.VSplitMid(&LeftLeft, &Button);
Button.VSplitLeft(50.0f, &Label, &Button);
Button.HMargin(2.0f, &Button);
UI()->DoLabelScaled(&Label, Localize("Size"), 14.0f, -1);
g_Config.m_ClTextEntitiesSize = (int)(DoScrollbarH(&g_Config.m_ClTextEntitiesSize, &Button, g_Config.m_ClTextEntitiesSize/100.0f)*100.0f);
if(DoButton_CheckBox(&g_Config.m_ClTextEntities, Localize("Show text entities"), g_Config.m_ClTextEntities, &LeftLeft))
{
g_Config.m_ClTextEntities ^= 1;
}
}
{
CUIRect Button, Label;
Left.HSplitTop(20.0f, &Button, &Left);
@ -2172,7 +2188,7 @@ void CMenus::RenderSettingsDDNet(CUIRect MainView)
CUIRect aRects[2];
Left.HSplitTop(5.0f, &Button, &Left);
Right.HSplitTop(5.0f, &Button, &Right);
Right.HSplitTop(25.0f, &Button, &Right);
aRects[0] = Left;
aRects[1] = Right;
aRects[0].VSplitRight(10.0f, &aRects[0], 0);

View file

@ -569,7 +569,7 @@ void CPlayers::RenderPlayer(
Graphics()->QuadsSetRotation(0);
}
if(g_Config.m_ClAfkEmote && m_pClient->m_aClients[ClientID].m_Afk && !(Player.m_PlayerFlags&PLAYERFLAG_CHATTING))
if(g_Config.m_ClAfkEmote && m_pClient->m_aClients[ClientID].m_Afk && !(Player.m_PlayerFlags&PLAYERFLAG_CHATTING) && !(m_pClient->Client()->DummyConnected() && ClientID == m_pClient->m_LocalIDs[!g_Config.m_ClDummy]))
{
Graphics()->TextureSet(g_pData->m_aImages[IMAGE_EMOTICONS].m_Id);
int QuadOffset = QuadOffsetToEmoticon + (SPRITE_ZZZ - SPRITE_OOP);

View file

@ -509,7 +509,7 @@ void CScoreboard::RenderScoreboard(float x, float y, float w, int Team, const ch
ColorRGBA rgb = color_cast<ColorRGBA>(ColorHSLA((300.0f - clamp(pInfo->m_Latency, 0, 300)) / 1000.0f, 1.0f, 0.5f));
TextRender()->TextColor(rgb);
}
str_format(aBuf, sizeof(aBuf), "%d", clamp(pInfo->m_Latency, 0, 1000));
str_format(aBuf, sizeof(aBuf), "%d", clamp(pInfo->m_Latency, 0, 999));
tw = TextRender()->TextWidth(nullptr, FontSize, aBuf, -1);
TextRender()->SetCursor(&Cursor, PingOffset+PingLength-tw, y + (LineHeight - FontSize) / 2.f, FontSize, TEXTFLAG_RENDER|TEXTFLAG_STOP_AT_END);
Cursor.m_LineWidth = PingLength;

View file

@ -390,8 +390,9 @@ void CGameClient::OnDummySwap()
{
if(g_Config.m_ClDummyResetOnSwitch)
{
m_pControls->ResetInput(!g_Config.m_ClDummy);
m_pControls->m_InputData[!g_Config.m_ClDummy].m_Hook = 0;
int PlayerOrDummy = (g_Config.m_ClDummyResetOnSwitch == 2) ? g_Config.m_ClDummy : (!g_Config.m_ClDummy);
m_pControls->ResetInput(PlayerOrDummy);
m_pControls->m_InputData[PlayerOrDummy].m_Hook = 0;
}
int tmp = m_DummyInput.m_Fire;
m_DummyInput = m_pControls->m_InputData[!g_Config.m_ClDummy];

View file

@ -270,8 +270,8 @@ void CCharacter::FireWeapon()
if (m_Jetpack && m_Core.m_ActiveWeapon == WEAPON_GUN)
FullAuto = true;
// don't fire non auto weapons when player is deep and sv_deepfly is disabled
if(!g_Config.m_SvDeepfly && !FullAuto && m_DeepFreeze)
// don't fire hammer when player is deep and sv_deepfly is disabled
if(!g_Config.m_SvDeepfly && m_Core.m_ActiveWeapon == WEAPON_HAMMER && m_DeepFreeze)
return;
// check if we gonna fire
@ -818,11 +818,11 @@ void CCharacter::HandleTiles(int Index)
if(Collision()->GetSwitchNumber(MapIndex) == 0 || Collision()->m_pSwitchers[Collision()->GetSwitchNumber(MapIndex)].m_Status[Team()])
Freeze(Collision()->GetSwitchDelay(MapIndex));
}
else if(Collision()->IsSwitch(MapIndex) == TILE_DFREEZE && Team() != TEAM_SUPER && Collision()->m_pSwitchers[Collision()->GetSwitchNumber(MapIndex)].m_Status[Team()])
else if(Collision()->IsSwitch(MapIndex) == TILE_DFREEZE && Team() != TEAM_SUPER && (Collision()->GetSwitchNumber(MapIndex) == 0 || Collision()->m_pSwitchers[Collision()->GetSwitchNumber(MapIndex)].m_Status[Team()]))
{
m_DeepFreeze = true;
}
else if(Collision()->IsSwitch(MapIndex) == TILE_DUNFREEZE && Team() != TEAM_SUPER && Collision()->m_pSwitchers[Collision()->GetSwitchNumber(MapIndex)].m_Status[Team()])
else if(Collision()->IsSwitch(MapIndex) == TILE_DUNFREEZE && Team() != TEAM_SUPER && (Collision()->GetSwitchNumber(MapIndex) == 0 || Collision()->m_pSwitchers[Collision()->GetSwitchNumber(MapIndex)].m_Status[Team()]))
{
m_DeepFreeze = false;
}

View file

@ -223,6 +223,9 @@ CCharacter *CGameWorld::IntersectCharacter(vec2 Pos0, vec2 Pos1, float Radius, v
if(p == pNotThis)
continue;
if(pThisOnly && p != pThisOnly)
continue;
if(CollideWith != -1 && !p->CanCollide(CollideWith))
continue;

View file

@ -229,7 +229,7 @@ static int GetMoveRestrictions(int Direction, int Tile, int Flags)
return Result&GetMoveRestrictionsMask(Direction);
}
int CCollision::GetMoveRestrictions(CALLBACK_SWITCHACTIVE pfnSwitchActive, void *pUser, vec2 Pos, float Distance)
int CCollision::GetMoveRestrictions(CALLBACK_SWITCHACTIVE pfnSwitchActive, void *pUser, vec2 Pos, float Distance, int OverrideCenterTileIndex)
{
static const vec2 DIRECTIONS[NUM_MR_DIRS] =
{
@ -245,6 +245,10 @@ int CCollision::GetMoveRestrictions(CALLBACK_SWITCHACTIVE pfnSwitchActive, void
{
vec2 ModPos = Pos + DIRECTIONS[d] * Distance;
int ModMapIndex = GetPureMapIndex(ModPos);
if(d == MR_DIR_HERE && OverrideCenterTileIndex >= 0)
{
ModMapIndex = OverrideCenterTileIndex;
}
for(int Front = 0; Front < 2; Front++)
{
int Tile;
@ -487,13 +491,16 @@ void CCollision::MoveBox(vec2 *pInoutPos, vec2 *pInoutVel, vec2 Size, float Elas
if(Distance > 0.00001f)
{
//vec2 old_pos = pos;
float Fraction = 1.0f/(float)(Max+1);
for(int i = 0; i <= Max; i++)
{
//float amount = i/(float)max;
//if(max == 0)
//amount = 0;
// Early break as optimization to stop checking for collisions for
// large distances after the obstacles we have already hit reduced
// our speed to exactly 0.
if(Vel == vec2(0, 0))
{
break;
}
vec2 NewPos = Pos + Vel*Fraction; // TODO: this row is not nice

View file

@ -60,7 +60,7 @@ public:
int GetIndex(vec2 PrevPos, vec2 Pos);
int GetFIndex(int x, int y);
int GetMoveRestrictions(CALLBACK_SWITCHACTIVE pfnSwitchActive, void *pUser, vec2 Pos, float Distance = 18.0f);
int GetMoveRestrictions(CALLBACK_SWITCHACTIVE pfnSwitchActive, void *pUser, vec2 Pos, float Distance = 18.0f, int OverrideCenterTileIndex = -1);
int GetMoveRestrictions(vec2 Pos, float Distance = 18.0f)
{
return GetMoveRestrictions(0, 0, Pos, Distance);

View file

@ -81,8 +81,15 @@ inline void StrToInts(int *pInts, int Num, const char *pStr)
while(Num)
{
char aBuf[4] = {0,0,0,0};
#ifdef __GNUC__
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Warray-bounds" // false positive
#endif
for(int c = 0; c < 4 && pStr[Index]; c++, Index++)
aBuf[c] = pStr[Index];
#ifdef __GNUC__
#pragma GCC diagnostic pop
#endif
*pInts = ((aBuf[0]+128)<<24)|((aBuf[1]+128)<<16)|((aBuf[2]+128)<<8)|(aBuf[3]+128);
pInts++;
Num--;
@ -258,8 +265,6 @@ public:
private:
CTeamsCore *m_pTeams;
int m_TileIndex;
int m_TileFlags;
int m_MoveRestrictions;
static bool IsSwitchActiveCb(int Number, void *pUser);
};

View file

@ -341,11 +341,15 @@ void CCharacter::FireWeapon()
bool FullAuto = false;
if(m_Core.m_ActiveWeapon == WEAPON_GRENADE || m_Core.m_ActiveWeapon == WEAPON_SHOTGUN || m_Core.m_ActiveWeapon == WEAPON_RIFLE)
FullAuto = true;
if (m_Jetpack && m_Core.m_ActiveWeapon == WEAPON_GUN)
if(m_Jetpack && m_Core.m_ActiveWeapon == WEAPON_GUN)
FullAuto = true;
// allow firing directly after coming out of freeze or being unfrozen
// by something
if(m_FrozenLastTick)
FullAuto = true;
// don't fire non auto weapons when player is deep and sv_deepfly is disabled
if(!g_Config.m_SvDeepfly && !FullAuto && m_DeepFreeze)
// don't fire hammer when player is deep and sv_deepfly is disabled
if(!g_Config.m_SvDeepfly && m_Core.m_ActiveWeapon == WEAPON_HAMMER && m_DeepFreeze)
return;
// check if we gonna fire
@ -368,8 +372,8 @@ void CCharacter::FireWeapon()
// Timer stuff to avoid shrieking orchestra caused by unfreeze-plasma
if(m_PainSoundTimer<=0)
{
m_PainSoundTimer = 1 * Server()->TickSpeed();
GameServer()->CreateSound(m_Pos, SOUND_PLAYER_PAIN_LONG, Teams()->TeamMask(Team(), -1, m_pPlayer->GetCID()));
m_PainSoundTimer = 1 * Server()->TickSpeed();
GameServer()->CreateSound(m_Pos, SOUND_PLAYER_PAIN_LONG, Teams()->TeamMask(Team(), -1, m_pPlayer->GetCID()));
}
return;
}
@ -728,7 +732,7 @@ void CCharacter::Tick()
m_pPlayer->m_ForceBalanced = false;
}*/
if (m_Paused)
if(m_Paused)
return;
DDRaceTick();
@ -1364,7 +1368,7 @@ void CCharacter::HandleTiles(int Index)
//int PureMapIndex = GameServer()->Collision()->GetPureMapIndex(m_Pos);
m_TileIndex = GameServer()->Collision()->GetTileIndex(MapIndex);
m_TileFIndex = GameServer()->Collision()->GetFTileIndex(MapIndex);
m_MoveRestrictions = GameServer()->Collision()->GetMoveRestrictions(IsSwitchActiveCb, this, m_Pos);
m_MoveRestrictions = GameServer()->Collision()->GetMoveRestrictions(IsSwitchActiveCb, this, m_Pos, 18.0f, MapIndex);
//Sensitivity
int S1 = GameServer()->Collision()->GetPureMapIndex(vec2(m_Pos.x + m_ProximityRadius / 3.f, m_Pos.y - m_ProximityRadius / 3.f));
int S2 = GameServer()->Collision()->GetPureMapIndex(vec2(m_Pos.x + m_ProximityRadius / 3.f, m_Pos.y + m_ProximityRadius / 3.f));
@ -1674,12 +1678,12 @@ void CCharacter::HandleTiles(int Index)
}
// stopper
m_Core.m_Vel = ClampVel(m_MoveRestrictions, m_Core.m_Vel);
if(m_MoveRestrictions&CANTMOVE_DOWN)
if(m_Core.m_Vel.y > 0 && (m_MoveRestrictions&CANTMOVE_DOWN))
{
m_Core.m_Jumped = 0;
m_Core.m_JumpedTotal = 0;
}
m_Core.m_Vel = ClampVel(m_MoveRestrictions, m_Core.m_Vel);
// handle switch tiles
if(GameServer()->Collision()->IsSwitch(MapIndex) == TILE_SWITCHOPEN && Team() != TEAM_SUPER && GameServer()->Collision()->GetSwitchNumber(MapIndex) > 0)
@ -2094,7 +2098,7 @@ void CCharacter::DDRacePostCoreTick()
if (m_pPlayer->m_DefEmoteReset >= 0 && m_pPlayer->m_DefEmoteReset <= Server()->Tick())
{
m_pPlayer->m_DefEmoteReset = -1;
m_pPlayer->m_DefEmoteReset = -1;
m_EmoteType = m_pPlayer->m_DefEmote = EMOTE_NORMAL;
m_EmoteStop = -1;
}
@ -2102,6 +2106,8 @@ void CCharacter::DDRacePostCoreTick()
if (m_EndlessHook || (m_Super && g_Config.m_SvEndlessSuperHook))
m_Core.m_HookTick = 0;
m_FrozenLastTick = false;
if (m_DeepFreeze && !m_Super)
Freeze();
@ -2161,10 +2167,12 @@ bool CCharacter::Freeze(int Seconds)
if (m_FreezeTick < Server()->Tick() - Server()->TickSpeed() || Seconds == -1)
{
for(int i = 0; i < NUM_WEAPONS; i++)
{
if(m_aWeapons[i].m_Got)
{
m_aWeapons[i].m_Ammo = 0;
}
{
m_aWeapons[i].m_Ammo = 0;
}
}
m_Armor = 0;
m_FreezeTime = Seconds == -1 ? Seconds : Seconds * Server()->TickSpeed();
m_FreezeTick = Server()->Tick();
@ -2192,7 +2200,7 @@ bool CCharacter::UnFreeze()
m_Core.m_ActiveWeapon = WEAPON_GUN;
m_FreezeTime = 0;
m_FreezeTick = 0;
if (m_Core.m_ActiveWeapon==WEAPON_HAMMER) m_ReloadTimer = 0;
m_FrozenLastTick = true;
return true;
}
return false;

View file

@ -193,6 +193,7 @@ public:
int m_TeamBeforeSuper;
int m_FreezeTime;
int m_FreezeTick;
bool m_FrozenLastTick;
bool m_DeepFreeze;
bool m_EndlessHook;
bool m_FreezeHammer;

View file

@ -28,7 +28,6 @@ CProjectile::CProjectile
m_Type = Type;
m_Pos = Pos;
m_Direction = Dir;
m_InitialLifeSpan = Span;
m_LifeSpan = Span;
m_Owner = Owner;
m_Force = Force;
@ -154,7 +153,7 @@ void CProjectile::Tick()
if(m_Explosive/*??*/ && (!pTargetChr || (pTargetChr && (!m_Freeze || (m_Type == WEAPON_SHOTGUN && Collide)))))
{
int Number = 1;
if(GameServer()->EmulateBug(BUG_GRENADE_DOUBLEEXPLOSION) && m_LifeSpan == -1 && m_InitialLifeSpan == 0)
if(GameServer()->EmulateBug(BUG_GRENADE_DOUBLEEXPLOSION) && m_LifeSpan == -1)
{
Number = 2;
}

View file

@ -32,7 +32,6 @@ public:
private:
vec2 m_Direction;
int m_InitialLifeSpan;
int m_LifeSpan;
int m_Owner;
int m_Type;

View file

@ -57,7 +57,7 @@ bool CEntity::GameLayerClipped(vec2 CheckPos)
bool CEntity::GetNearestAirPos(vec2 Pos, vec2 PrevPos, vec2* pOutPos)
{
while (GameServer()->Collision()->CheckPoint(Pos))
for(int k = 0; k < 16 && GameServer()->Collision()->CheckPoint(Pos); k++)
{
Pos -= normalize(PrevPos - Pos);
}

View file

@ -304,6 +304,9 @@ CCharacter *CGameWorld::IntersectCharacter(vec2 Pos0, vec2 Pos1, float Radius, v
if(p == pNotThis)
continue;
if(pThisOnly && p != pThisOnly)
continue;
if(CollideWith != -1 && !p->CanCollide(CollideWith))
continue;

View file

@ -27,6 +27,7 @@ CPlayer::CPlayer(CGameContext *pGameServer, int ClientID, int Team)
CPlayer::~CPlayer()
{
delete m_pLastTarget;
delete m_pCharacter;
m_pCharacter = 0;
}
@ -55,7 +56,7 @@ void CPlayer::Reset()
// DDRace
m_LastCommandPos = 0;
m_LastPlaytime = time_get();
m_LastPlaytime = 0;
m_Sent1stAfkWarning = 0;
m_Sent2ndAfkWarning = 0;
m_ChatScore = 0;
@ -63,11 +64,12 @@ void CPlayer::Reset()
m_EyeEmote = true;
m_TimerType = (g_Config.m_SvDefaultTimerType == CPlayer::TIMERTYPE_GAMETIMER || g_Config.m_SvDefaultTimerType == CPlayer::TIMERTYPE_GAMETIMER_AND_BROADCAST) ? CPlayer::TIMERTYPE_BROADCAST : g_Config.m_SvDefaultTimerType;
m_DefEmote = EMOTE_NORMAL;
m_Afk = false;
m_Afk = true;
m_LastWhisperTo = -1;
m_LastSetSpectatorMode = 0;
m_TimeoutCode[0] = '\0';
delete m_pLastTarget;
m_pLastTarget = nullptr;
m_TuneZone = 0;
m_TuneZoneOld = m_TuneZone;
m_Halloween = false;
@ -195,7 +197,7 @@ void CPlayer::Tick()
if(!GameServer()->m_World.m_Paused)
{
int EarliestRespawnTick = m_PreviousDieTick+Server()->TickSpeed()*3;
int RespawnTick = maximum(m_DieTick, EarliestRespawnTick);
int RespawnTick = maximum(m_DieTick, EarliestRespawnTick)+2;
if(!m_pCharacter && RespawnTick <= Server()->Tick())
m_Spawning = true;
@ -655,10 +657,17 @@ void CPlayer::AfkVoteTimer(CNetObj_PlayerInput *NewTarget)
if(g_Config.m_SvMaxAfkVoteTime == 0)
return;
if(mem_comp(NewTarget, &m_LastTarget, sizeof(CNetObj_PlayerInput)) != 0)
if(!m_pLastTarget)
{
m_pLastTarget = new CNetObj_PlayerInput(*NewTarget);
m_LastPlaytime = 0;
m_Afk = true;
return;
}
else if(mem_comp(NewTarget, m_pLastTarget, sizeof(CNetObj_PlayerInput)) != 0)
{
m_LastPlaytime = time_get();
mem_copy(&m_LastTarget, NewTarget, sizeof(CNetObj_PlayerInput));
mem_copy(m_pLastTarget, NewTarget, sizeof(CNetObj_PlayerInput));
}
else if(m_LastPlaytime < time_get()-time_freq()*g_Config.m_SvMaxAfkVoteTime)
{

View file

@ -141,7 +141,7 @@ public:
PAUSE_PAUSED,
PAUSE_SPEC
};
enum
{
TIMERTYPE_GAMETIMER=0,
@ -183,7 +183,7 @@ public:
bool m_LastBroadcastImportance;
int m_LastTarget_x;
int m_LastTarget_y;
CNetObj_PlayerInput m_LastTarget;
CNetObj_PlayerInput *m_pLastTarget;
int m_Sent1stAfkWarning; // afk timer's 1st warning after 50% of sv_max_afk_time
int m_Sent2ndAfkWarning; // afk timer's 2nd warning after 90% of sv_max_afk_time
char m_pAfkMsg[160];

View file

@ -646,8 +646,6 @@ void CGameTeams::OnCharacterSpawn(int ClientID)
void CGameTeams::OnCharacterDeath(int ClientID, int Weapon)
{
GameServer()->m_apPlayers[ClientID]->Respawn(); // queue the spawn as kill tiles don't
m_Core.SetSolo(ClientID, false);
int Team = m_Core.Team(ClientID);

View file

@ -114,7 +114,7 @@ MACRO_CONFIG_COL(ClDummyColorFeet, dummy_color_feet, 65408, CFGFLAG_CLIENT|CFGFL
MACRO_CONFIG_STR(ClDummySkin, dummy_skin, 24, "default", CFGFLAG_CLIENT|CFGFLAG_SAVE, "Dummy skin")
MACRO_CONFIG_INT(ClDummy, cl_dummy, 0, 0, 1, CFGFLAG_CLIENT, "0 - player / 1 - dummy")
MACRO_CONFIG_INT(ClDummyHammer, cl_dummy_hammer, 0, 0, 1, CFGFLAG_CLIENT, "Whether dummy is hammering for a hammerfly")
MACRO_CONFIG_INT(ClDummyResetOnSwitch, cl_dummy_resetonswitch, 0, 0, 1, CFGFLAG_CLIENT|CFGFLAG_SAVE, "Whether dummy should stop pressing keys when you switch")
MACRO_CONFIG_INT(ClDummyResetOnSwitch, cl_dummy_resetonswitch, 0, 0, 2, CFGFLAG_CLIENT|CFGFLAG_SAVE, "Whether dummy or player should stop pressing keys when you switch. 0 = off, 1 = dummy, 2 = player")
MACRO_CONFIG_INT(ClDummyRestoreWeapon, cl_dummy_restore_weapon, 1, 0, 1, CFGFLAG_CLIENT|CFGFLAG_SAVE, "Whether dummy should switch to last weapon after hammerfly")
MACRO_CONFIG_INT(ClDummyCopyMoves, cl_dummy_copy_moves, 0, 0, 1, CFGFLAG_CLIENT, "Whether dummy should copy your moves")

View file

@ -2,9 +2,9 @@
/* If you are missing that file, acquire a complete release at teeworlds.com. */
#ifndef GAME_VERSION_H
#define GAME_VERSION_H
#define GAME_VERSION "0.6.4, 12.6.1"
#define GAME_VERSION "0.6.4, 12.7.3"
#define GAME_NETVERSION "0.6 626fce9a778df4d4"
#define GAME_RELEASE_VERSION "12.6.1"
#define CLIENT_VERSIONNR 12061
#define GAME_RELEASE_VERSION "12.7.3"
#define CLIENT_VERSIONNR 12073
extern const char *GIT_SHORTREV_HASH;
#endif