Skip to content

Commit

Permalink
Merge dev into main (0.7.6-beta)
Browse files Browse the repository at this point in the history
Merge dev into main (0.7.6-beta)
  • Loading branch information
maxvollmer authored May 7, 2023
2 parents 68a1382 + e7966eb commit f05957a
Show file tree
Hide file tree
Showing 7 changed files with 65 additions and 28 deletions.
9 changes: 9 additions & 0 deletions docs/release-notes.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,15 @@ A highly immersive Virtual Reality mod for the classic Half-Life from 1998.
### Release Notes


#### 0.7.6-beta - 2023-05-07

##### Mod:
- Fixed several achievements not correctly working (Thanks DmitryShaburov!)
- Fixed rare crash that could happen if a certain achievement was given in the first frame after a levelchange

##### HLVRConfig:
- No changes

#### 0.7.5-beta - 2023-02-13

##### Mod:
Expand Down
8 changes: 4 additions & 4 deletions src/dlls/VRAchievementsAndStatsTracker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ void VRAchievementsAndStatsTracker::PlayerTakeNegativeCrushDamage(CBaseEntity* p

void CheckRigorousResearchAchievement(CBasePlayer* pPlayer)
{
if (pPlayer->GetAchievementsAndStatsData().m_exp1HeadcrabsKilled >= 5 && pPlayer->GetAchievementsAndStatsData().m_exp1HeadcrabsKilled >= 7)
if (pPlayer->GetAchievementsAndStatsData().m_exp1HeadcrabsKilled >= 5 && pPlayer->GetAchievementsAndStatsData().m_exp2HeadcrabsKilled >= 7)
{
UTIL_VRGiveAchievementAll(VRAchievement::QE_RIGOROUS);
}
Expand Down Expand Up @@ -126,8 +126,8 @@ void VRAchievementsAndStatsTracker::SmthKilledSmth(struct entvars_s* pKiller, st
{
// Power Up gargantua
if (FStrEq(STRING(INDEXENT(0)->v.model), "maps/c2a1.bsp")
&& FClassnameIs(pKiller, "trigger_hurt")
&& FStrEq(STRING(pKiller->targetname), "electro_hurt"))
&& FClassnameIs(pKiller, "env_laser")
&& FStrEq(STRING(pKiller->targetname), "gargbeams"))
{
UTIL_VRGiveAchievementAll(VRAchievement::PU_BBQ);
pHostPlayer->GetAchievementsAndStatsData().AnyKilled();
Expand Down Expand Up @@ -159,7 +159,7 @@ void VRAchievementsAndStatsTracker::SmthKilledSmth(struct entvars_s* pKiller, st
UTIL_VRGiveAchievementAll(VRAchievement::QE_PRECISURGERY);
pHostPlayer->GetAchievementsAndStatsData().FriendlyKilled();
}
else
else if (!FClassnameIs(pKilled, "monster_scientist_dead"))
{
pHostPlayer->GetAchievementsAndStatsData().AnyKilled();
}
Expand Down
4 changes: 3 additions & 1 deletion src/dlls/monsters.h
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,9 @@ class CGib : public CBaseEntity
SetTouch(nullptr);
m_hThrower = m_vrDragger; // set this here. once the player let's go we check in StickyGibTouch or BounceGibTouch if we hit an NPC

if (m_vrDragger && m_vrDragger->IsNetClient() && FStrEq(STRING(pev->model), "models/agibs.mdl"))
if (m_vrDragger
&& m_vrDragger->IsNetClient()
&& (FStrEq(STRING(pev->model), "models/agibs.mdl") || FStrEq(STRING(pev->model), "models/SD/agibs.mdl")))
{
UTIL_VRGiveAchievement(m_vrDragger, VRAchievement::GEN_ALIENGIB);
}
Expand Down
14 changes: 0 additions & 14 deletions src/dlls/nihilanth.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -838,20 +838,6 @@ void CNihilanth::NextActivity()
{
m_iTeleport++;
pev->sequence = LookupSequence("attack1"); // zap

// check if we went through all tele targets!
{
sprintf_s(szText, "%s%d", m_szTeleportTouch, m_iTeleport);
pTouch = UTIL_FindEntityByTargetname(nullptr, szText);

sprintf_s(szText, "%s%d", m_szTeleportUse, m_iTeleport);
pTrigger = UTIL_FindEntityByTargetname(nullptr, szText);

if (pTrigger == nullptr || pTouch == nullptr)
{
UTIL_VRGiveAchievementAll(VRAchievement::N_EXPLORER);
}
}
}
}
}
Expand Down
6 changes: 6 additions & 0 deletions src/dlls/player.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6308,6 +6308,12 @@ void CBasePlayer::VRJustTeleported(const Vector& fromOrigin, const Vector& fromA

void EXPORT CBaseEntity::DragThink(void)
{
// can happen afer a levelchange, should get fixed in the next VRControllerInteractionManager::HandleGrabbables update
if (!m_vrDragger)
{
return;
}

if (m_isFirstDragThink)
{
m_isFirstDragThink = false;
Expand Down
47 changes: 38 additions & 9 deletions src/dlls/triggers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1267,6 +1267,15 @@ void CBaseTrigger::ActivateMultiTrigger(CBaseEntity* pActivator)
UTIL_VRGiveAchievement(pActivator, VRAchievement::BP_BROKENELVTR);
}
}
// nihilanth lair
else if (FStrEq(STRING(INDEXENT(0)->v.model), "maps/c4a3.bsp"))
{
// teleporter in last nihilanth space
if (FStrEq(STRING(pev->model), "*60"))
{
UTIL_VRGiveAchievement(pActivator, VRAchievement::N_EXPLORER);
}
}
}
}
}
Expand Down Expand Up @@ -2049,15 +2058,6 @@ void CTriggerPush::Touch(CBaseEntity* pOther)
pPlayer->VRJustGotYeetedByBPTrain();
}
}
// residue processing map with all those conveyor belts
else if (FStrEq(STRING(INDEXENT(0)->v.model), "maps/c2a4c.bsp"))
{
// trigger_push that player has to pass when taking the wrong turn and coming back to start
if (FStrEq(STRING(pev->model), "*78"))
{
UTIL_VRGiveAchievement(pPlayer, VRAchievement::RP_MOEBIUS);
}
}
}
}
}
Expand All @@ -2074,6 +2074,20 @@ void CTriggerPush::Touch(CBaseEntity* pOther)

pevToucher->flags |= FL_BASEVELOCITY;
// ALERT( at_console, "Vel %f, base %f\n", pevToucher->velocity.z, pevToucher->basevelocity.z );

if (pOther->IsNetClient())
{
CBasePlayer* pPlayer = dynamic_cast<CBasePlayer*>(pOther);

// player in residue processing map with all those conveyor belts interacts with
// trigger_push that player has to pass when taking the wrong turn and coming back to start
if (pPlayer
&& FStrEq(STRING(INDEXENT(0)->v.model), "maps/c2a4c.bsp")
&& FStrEq(STRING(pev->model), "*78"))
{
UTIL_VRGiveAchievement(pPlayer, VRAchievement::RP_MOEBIUS);
}
}
}
}
}
Expand Down Expand Up @@ -2153,6 +2167,21 @@ void CBaseTrigger::TeleportTouch(CBaseEntity* pOther)
if (pPlayer)
{
pPlayer->VRJustTeleported(prevOrigin, prevAngles);

// endgame map
if (FStrEq(STRING(INDEXENT(0)->v.model), "maps/c5a1.bsp"))
{
// teleport at the exit of train to black screen (joined g-man)
if (FStrEq(STRING(pev->target), "endroom"))
{
UTIL_VRGiveAchievement(pPlayer, VRAchievement::END_LIMITLESS);
}
// teleport in the train to grunt army (refused g-man)
else if (FStrEq(STRING(pev->target), "loser"))
{
UTIL_VRGiveAchievement(pPlayer, VRAchievement::END_UNWINNABLE);
}
}
}
}
}
Expand Down
5 changes: 5 additions & 0 deletions src/dlls/util.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3359,6 +3359,11 @@ void CHANGE_LEVEL(char* s1, char* s2)

void UTIL_VRGiveAchievement(CBaseEntity* pPlayer, VRAchievement achievement)
{
if (!pPlayer)
{
UTIL_VRGiveAchievementAll(achievement);
return;
}
extern int gmsgVRAchievement;
MESSAGE_BEGIN(MSG_ONE, gmsgVRAchievement, nullptr, pPlayer->edict());
WRITE_LONG((int)achievement);
Expand Down

0 comments on commit f05957a

Please sign in to comment.