Permalink
Browse files

Fallback to weapon_base if no SWEP.Base is given.

Fixed Alyxgun sounds
Fixed some Episode 2 sound scripts not loading
  • Loading branch information...
1 parent 532aef2 commit 7d9687929f76d5ef0c53deb0e3cdfc7f1d9540c4 @robotboy655 robotboy655 committed Jan 19, 2015
@@ -11,21 +11,20 @@ local function TableInherit( t, base )
for k, v in pairs( base ) do
- if ( t[k] == nil ) then
- t[k] = v
- elseif ( k != "BaseClass" && istable(t[k]) ) then
- TableInherit( t[k], v )
+ if ( t[ k ] == nil ) then
+ t[ k ] = v
+ elseif ( k != "BaseClass" && istable( t[ k ] ) ) then
+ TableInherit( t[ k ], v )
end
end
-
- t["BaseClass"] = base
-
+
+ t[ "BaseClass" ] = base
+
return t
end
-
--[[---------------------------------------------------------
Name: Register( table, string, bool )
Desc: Used to register your SWEP with the engine
@@ -35,17 +34,17 @@ function Register( t, name )
local old = WeaponList[ name ]
t.ClassName = name
- WeaponList[ name ] = t
-
+ WeaponList[ name ] = t
+
--baseclass.Set( name, t )
- list.Set( "Weapon", name, {
- ClassName = name,
- PrintName = t.PrintName or t.ClassName,
- Category = t.Category or "Other",
- Spawnable = t.Spawnable,
- AdminOnly = t.AdminOnly,
- })
+ list.Set( "Weapon", name, {
+ ClassName = name,
+ PrintName = t.PrintName or t.ClassName,
+ Category = t.Category or "Other",
+ Spawnable = t.Spawnable,
+ AdminOnly = t.AdminOnly,
+ } )
-- Allow all SWEPS to be duplicated, unless specified
if ( !t.DisableDuplicator ) then
@@ -81,7 +80,6 @@ function Register( t, name )
end
-
--
-- All scripts have been loaded...
--
@@ -97,9 +95,8 @@ function OnLoaded()
baseclass.Set( k, Get( k ) )
end )
-
-end
+end
--[[---------------------------------------------------------
Name: Get( string )
@@ -112,19 +109,20 @@ function Get( name )
-- Create/copy a new table
local retval = table.Copy( Stored )
-
+ retval.Base = retval.Base or "weapon_base"
+
-- If we're not derived from ourselves (a base weapon)
-- then derive from our 'Base' weapon.
if ( retval.Base != name ) then
-
+
local BaseWeapon = Get( retval.Base )
-
+
if ( !BaseWeapon ) then
Msg( "SWEP (", name, ") is derived from non existant SWEP (", retval.Base, ") - Expect errors!\n" )
else
retval = TableInherit( retval, Get( retval.Base ) )
end
-
+
end
return retval
@@ -144,9 +142,9 @@ end
-----------------------------------------------------------]]
function GetList()
local result = {}
-
- for k,v in pairs(WeaponList) do
- table.insert(result, v)
+
+ for k, v in pairs( WeaponList ) do
+ table.insert( result, v )
end
return result
@@ -5,8 +5,6 @@ game_sounds_manifest
"precache_file" "scripts/sounds/cs_game_sounds_radio.txt"
"precache_file" "scripts/sounds/cs_game_sounds_weapons.txt"
"precache_file" "scripts/sounds/dod_game_sounds_weapons.txt"
- "precache_file" "scripts/sounds/game_sounds_vehicles_ep2.txt"
- "precache_file" "scripts/sounds/game_sounds_weapons_ep2.txt"
"precache_file" "scripts/sounds/hl1_game_sounds.txt"
"precache_file" "scripts/sounds/hl2_game_sounds.txt"
"precache_file" "scripts/sounds/hl2_game_sounds_ambient_generic.txt"
@@ -36,12 +34,8 @@ game_sounds_manifest
"precache_file" "scripts/sounds/level_sounds_streetwar2.txt"
"precache_file" "scripts/sounds/level_sounds_trainyard.txt"
"precache_file" "scripts/sounds/npc_sounds_alyx.txt"
- "precache_file" "scripts/sounds/npc_sounds_alyx_episodic.txt"
- "precache_file" "scripts/sounds/npc_sounds_alyx_episodic2.txt"
"precache_file" "scripts/sounds/npc_sounds_antlion.txt"
"precache_file" "scripts/sounds/npc_sounds_antlionguard.txt"
- "precache_file" "scripts/sounds/npc_sounds_antlion_episodic.txt"
- "precache_file" "scripts/sounds/npc_sounds_antlion_grub_episodic.txt"
"precache_file" "scripts/sounds/npc_sounds_attackheli.txt"
"precache_file" "scripts/sounds/npc_sounds_barnacle.txt"
"precache_file" "scripts/sounds/npc_sounds_barney.txt"
@@ -57,35 +51,46 @@ game_sounds_manifest
"precache_file" "scripts/sounds/npc_sounds_env_headcrabcanister.txt"
"precache_file" "scripts/sounds/npc_sounds_fastheadcrab.txt"
"precache_file" "scripts/sounds/npc_sounds_fastzombie.txt"
- "precache_file" "scripts/sounds/npc_sounds_fastzombie_episodic2.txt"
"precache_file" "scripts/sounds/npc_sounds_gman.txt"
"precache_file" "scripts/sounds/npc_sounds_gunship.txt"
"precache_file" "scripts/sounds/npc_sounds_headcrab.txt"
- "precache_file" "scripts/sounds/npc_sounds_hunter.txt"
"precache_file" "scripts/sounds/npc_sounds_ichthyosaur.txt"
"precache_file" "scripts/sounds/npc_sounds_manhack.txt"
"precache_file" "scripts/sounds/npc_sounds_metropolice.txt"
- "precache_file" "scripts/sounds/npc_sounds_ministrider_episodic.txt"
"precache_file" "scripts/sounds/npc_sounds_poisonzombie.txt"
"precache_file" "scripts/sounds/npc_sounds_rollermine.txt"
"precache_file" "scripts/sounds/npc_sounds_scanner.txt"
"precache_file" "scripts/sounds/npc_sounds_sniper.txt"
"precache_file" "scripts/sounds/npc_sounds_soldier.txt"
- "precache_file" "scripts/sounds/npc_sounds_stalker.txt"
"precache_file" "scripts/sounds/npc_sounds_strider.txt"
- "precache_file" "scripts/sounds/npc_sounds_strider_episodic2.txt"
"precache_file" "scripts/sounds/npc_sounds_turret.txt"
- "precache_file" "scripts/sounds/npc_sounds_turret_episodic2.txt"
"precache_file" "scripts/sounds/npc_sounds_vortigaunt.txt"
"precache_file" "scripts/sounds/npc_sounds_zombie.txt"
"precache_file" "scripts/sounds/phx.txt"
- "precache_file" "scripts/sounds/tf2_game_sounds_weapons.txt"
- "precache_file" "scripts/sounds/level_sounds_lostcoast.txt"
- "precache_file" "scripts/sounds/level_voices_lostcoast.txt"
+
+ // Episode 2
"precache_file" "scripts/sounds/game_sounds_addendum_ep2.txt"
- "precache_file" "scripts/sounds/level_voices_episode_02.txt"
+ "precache_file" "scripts/game_sounds_ambient_generic_ep2.txt"
+ "precache_file" "scripts/game_sounds_physics_ep2.txt"
+ "precache_file" "scripts/sounds/game_sounds_vehicles_ep2.txt"
+ "precache_file" "scripts/sounds/game_sounds_weapons_ep2.txt"
+
+ "precache_file" "scripts/sounds/level_sounds_music_episodic2.txt"
"precache_file" "scripts/sounds/level_sounds_outland_episodic.txt"
- "precache_file" "scripts/sounds/level_sounds_music_episodic2.txt"
+ "precache_file" "scripts/sounds/level_voices_episode_02.txt"
+
+ "precache_file" "scripts/npc_sounds_advisor_episodic2.txt"
+ "precache_file" "scripts/sounds/npc_sounds_alyx_episodic2.txt"
+ "precache_file" "scripts/sounds/npc_sounds_antlion_episodic.txt"
+ "precache_file" "scripts/sounds/npc_sounds_antlion_grub_episodic.txt"
+ "precache_file" "scripts/npc_sounds_antlionguard_episodic2.txt"
+ "precache_file" "scripts/npc_sounds_attackheli_episodic2.txt"
+ "precache_file" "scripts/npc_sounds_citizen_episodic2.txt"
+ "precache_file" "scripts/npc_sounds_combine_cannon.txt"
+ "precache_file" "scripts/sounds/npc_sounds_fastzombie_episodic2.txt"
+ "precache_file" "scripts/sounds/npc_sounds_hunter.txt"
+ "precache_file" "scripts/sounds/npc_sounds_strider_episodic2.txt"
+ "precache_file" "scripts/sounds/npc_sounds_turret_episodic2.txt"
//Portal
"precache_file" "scripts/game_sounds_portal.txt"
@@ -99,19 +104,23 @@ game_sounds_manifest
"precache_file" "scripts/npc_sounds_turret_portal.txt"
"precache_file" "scripts/npc_sounds_rocket_turret.txt"
"precache_file" "scripts/npc_sounds_glados_cores.txt"
-
+
// Episodic content sounds
+ "precache_file" "scripts/npc_sounds_advisor.txt"
+
+ "precache_file" "scripts/npc_sounds_antlionguard_episodic.txt"
+ "precache_file" "scripts/sounds/npc_sounds_alyx_episodic.txt"
+ "precache_file" "scripts/npc_sounds_citizen_ep1.txt"
+ "precache_file" "scripts/npc_sounds_citizen_episodic.txt"
+ "precache_file" "scripts/npc_sounds_combine_ball_episodic.txt"
+ "precache_file" "scripts/npc_sounds_dog_episodic.txt"
+ "precache_file" "scripts/sounds/npc_sounds_ministrider_episodic.txt"
+ "precache_file" "scripts/npc_sounds_roller_episodic.txt"
+ "precache_file" "scripts/npc_sounds_soldier_episodic.txt"
+ "precache_file" "scripts/sounds/npc_sounds_stalker.txt"
"precache_file" "scripts/npc_sounds_strider_episodic.txt"
"precache_file" "scripts/npc_sounds_turret_episodic.txt"
- "precache_file" "scripts/npc_sounds_soldier_episodic.txt"
- "precache_file" "scripts/npc_sounds_roller_episodic.txt"
- "precache_file" "scripts/npc_sounds_combine_ball_episodic.txt"
- "precache_file" "scripts/npc_sounds_citizen_episodic.txt"
- "precache_file" "scripts/npc_sounds_citizen_ep1.txt"
"precache_file" "scripts/npc_sounds_zombine.txt"
- "precache_file" "scripts/npc_sounds_dog_episodic.txt"
- "precache_file" "scripts/npc_sounds_antlionguard_episodic.txt"
- "precache_file" "scripts/npc_sounds_advisor.txt"
"precache_file" "scripts/level_sounds_e3_c17.txt"
"precache_file" "scripts/level_sounds_e3_town.txt"
@@ -121,13 +130,17 @@ game_sounds_manifest
"precache_file" "scripts/level_voices_episode_01.txt"
"precache_file" "scripts/level_sounds_aftermath_episodic.txt"
- "precache_file" "scripts/level_sounds_outland_episodic.txt"
"precache_file" "scripts/level_sounds_c17_02a.txt"
+
+ // Lost coast
+ "precache_file" "scripts/sounds/level_sounds_lostcoast.txt"
+ "precache_file" "scripts/sounds/level_voices_lostcoast.txt"
// Team Fortress 2
"precache_file" "scripts/game_sounds_mvm.txt"
"precache_file" "scripts/game_sounds_vo.txt"
"precache_file" "scripts/game_sounds_vo_mvm.txt"
"precache_file" "scripts/game_sounds_vo_mvm_handmade.txt"
"precache_file" "scripts/game_sounds_vo_mvm_mighty.txt"
+ "precache_file" "scripts/sounds/tf2_game_sounds_weapons.txt"
}
@@ -3,15 +3,11 @@ soundscapes_manifest
"file" "scripts/soundscapes.txt"
// Gmod
-
"file" "scripts/soundscapes_garrysmod.txt"
// HL2
-
"file" "scripts/soundscapes_lostcoast.txt"
- "file" "scripts/soundscapes_citadel_episodic.txt"
- "file" "scripts/soundscapes_city_episodic.txt"
-
+
"file" "scripts/soundscapes_canals.txt"
"file" "scripts/soundscapes_klab.txt"
"file" "scripts/soundscapes_elab.txt"
@@ -23,7 +19,6 @@ soundscapes_manifest
"file" "scripts/soundscapes_trainyard.txt"
// CS:S
-
"file" "scripts/soundscapes_dust.txt"
"file" "scripts/soundscapes_italy.txt"
"file" "scripts/soundscapes_aztec.txt"
@@ -45,13 +40,15 @@ soundscapes_manifest
"file" "scripts/soundscapes_militia.txt"
// EP2
-
"file" "scripts/soundscapes_silo.txt"
- "file" "scripts/soundscapes_outland.txt"
+ "file" "scripts/soundscapes_outland.txt"
"file" "scripts/soundscapes_outland2.txt"
- // TF2
+ // EP1
+ "file" "scripts/soundscapes_citadel_episodic.txt"
+ "file" "scripts/soundscapes_city_episodic.txt"
+ // TF2
"file" "scripts/soundscapes_2fort.txt"
"file" "scripts/soundscapes_dustbowl.txt"
"file" "scripts/soundscapes_well.txt"
@@ -83,22 +80,20 @@ soundscapes_manifest
"file" "scripts/soundscapes_deathpit.txt"
"file" "scripts/soundscapes_mannworks.txt"
"file" "scripts/soundscapes_cactusvalley.txt"
- "file" "scripts/soundscapes_soho.txt"
+ "file" "scripts/soundscapes_soho.txt"
// DOD:S
-
"file" "scripts/soundscapes_colmar.txt"
"file" "scripts/soundscapes_kalt.txt"
"file" "scripts/soundscapes_flash.txt"
"file" "scripts/soundscapes_anzio.txt"
"file" "scripts/soundscapes_avalanche.txt"
- "file" "scripts/soundscapes_donner.txt"
+ "file" "scripts/soundscapes_donner.txt"
"file" "scripts/soundscapes_argentan.txt"
"file" "scripts/soundscapes_jagd.txt"
"file" "scripts/soundscapes_dod_palermo.txt"
// Portal
- "file" "scripts/soundscapes_portal.txt"
"file" "scripts/soundscapes_testchmb_portal.txt"
"file" "scripts/soundscapes_escape_portal.txt"
}
@@ -25,14 +25,14 @@ WeaponData
SoundData
{
- "reload" "Weapon_Pistol.Reload"
- "reload_npc" "Weapon_Pistol.NPC_Reload"
- "empty" "Weapon_Pistol.Empty"
- "single_shot" "Weapon_Pistol.Single"
- "single_shot_npc" "Weapon_Pistol.NPC_Single"
- "special1" "Weapon_Pistol.Special1"
- "special2" "Weapon_Pistol.Special2"
- "burst" "Weapon_Pistol.Burst"
+ "reload" "Weapon_Alyx_Gun.Reload"
+ "reload_npc" "Weapon_Alyx_Gun.NPC_Reload"
+ "empty" "Weapon_Alyx_Gun.Empty"
+ "single_shot" "Weapon_Alyx_Gun.Single"
+ "single_shot_npc" "Weapon_Alyx_Gun.NPC_Single"
+ "special1" "Weapon_Alyx_Gun.Special1"
+ "special2" "Weapon_Alyx_Gun.Special2"
+ "burst" "Weapon_Alyx_Gun.Burst"
}
// Weapon Sprite data is loaded by the Client DLL.

0 comments on commit 7d96879

Please sign in to comment.