Minor HS fixes

This commit is contained in:
Jackz 2022-06-27 11:39:14 -05:00
parent 09fe247134
commit 24ca8e73cc
No known key found for this signature in database
GPG key ID: E0BBD94CF657F603
4 changed files with 16 additions and 40 deletions

View file

@ -312,6 +312,7 @@ public Action OnClientSayCommand(int client, const char[] command, const char[]
public Action Command_Join(int client, int args) {
if(!isEnabled) return Plugin_Continue;
static float tpLoc[3];
GetSpawnPosition(tpLoc);
if(args == 1) {

View file

@ -1,10 +1,12 @@
#include <hideandseek/hsgame>
#include <hideandseek/hscmds>
#include <hideandseek/hsents>
#include <hideandseek/hscmds>
static KeyValues kv;
StringMap mapConfigs;
static float DEFAULT_SCALE[3] = { 5.0, 5.0, 5.0 };
bool ReloadMapDB() {
if(kv != null) {
delete kv;

View file

@ -308,4 +308,5 @@ stock void GetViewVector(float fVecAngle[3], float fOutPut[3])
bool Filter_IgnoreAll(int entity, int mask) {
return false;
}
}

View file

@ -12,10 +12,10 @@
#include <sdktools>
#include <left4dhooks>
#include <sceneprocessor>
#include <basegamemode>
#include <multicolors>
#if defined DEBUG_BLOCKERS
#include <smlib/effects>
int g_iLaserIndex;
#endif
public Plugin myinfo =
@ -60,53 +60,17 @@ enum GameState {
State_Hunting
}
char gamemode[32], currentMap[64];
bool isEnabled, lateLoaded;
bool isPendingPlay[MAXPLAYERS+1];
bool isNavBlockersEnabled = true, isPropsEnabled = true, isPortalsEnabled = true;
bool isNearbyPlaying[MAXPLAYERS+1];
bool wasThirdPersonVomitted[MAXPLAYERS+1];
bool gameOver;
int currentSeeker;
int currentPlayers = 0;
float DEFAULT_SCALE[3] = { 5.0, 5.0, 5.0 };
char currentSet[16] = "default";
Handle suspenseTimer, thirdPersonTimer;
char nextRoundMap[64];
int seekerCam = INVALID_ENT_REFERENCE;
bool isViewingCam[MAXPLAYERS+1];
int g_BeamSprite;
int g_HaloSprite;
enum struct EntityConfig {
float origin[3];
float rotation[3];
char type[32];
char model[64];
float scale[3];
float offset[3];
}
enum struct MapConfig {
ArrayList entities;
ArrayList inputs;
float spawnpoint[3];
bool hasSpawnpoint;
int mapTime;
bool canClimb;
bool pressButtons;
}
MapConfig mapConfig;
ArrayList validMaps;
ArrayList validSets;
bool hasBeenSeeker[MAXPLAYERS+1];
bool ignoreSeekerBalance;
@ -244,6 +208,14 @@ public Action L4D2_OnChangeFinaleStage(int &finaleType, const char[] arg) {
return Plugin_Continue;
}
public void OnSceneStageChanged(int scene, SceneStages stage) {
if(isEnabled && stage == SceneStage_Spawned) {
int activator = GetSceneInitiator(scene);
if(activator != GetActorFromScene(scene)) {
CancelScene(scene);
}
}
}
public void Event_GamemodeChange(ConVar cvar, const char[] oldValue, const char[] newValue) {
cvar.GetString(gamemode, sizeof(gamemode));
@ -278,7 +250,7 @@ public void Event_GamemodeChange(ConVar cvar, const char[] oldValue, const char[
}
}
}
} else if(!lateLoaded && suspenseTimer != null) {
} else if(!lateLoaded) {
UnhookEvent("round_end", Event_RoundEnd);
UnhookEvent("round_start", Event_RoundStart);
UnhookEvent("item_pickup", Event_ItemPickup);