Skip to content

Commit

Permalink
Merge pull request #8 from punteroo/development
Browse files Browse the repository at this point in the history
Fix not resetting weapon overrides on spawn
Fix Unusual overrides not showing up on menu
  • Loading branch information
punteroo authored Oct 14, 2021
2 parents 07b32f9 + e392e01 commit 2836cf8
Show file tree
Hide file tree
Showing 7 changed files with 29 additions and 16 deletions.
Binary file modified plugins/tf2item_cosmetics.smx
Binary file not shown.
Binary file modified plugins/tf2item_weapons.smx
Binary file not shown.
4 changes: 2 additions & 2 deletions scripting/tf2item_cosmetics.sp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#pragma semicolon 1
#pragma newdecls required

#define PLUGIN_VERSION "3.0.1"
#define PLUGIN_VERSION "3.0.2"

public Plugin myinfo =
{
Expand Down Expand Up @@ -456,7 +456,7 @@ void IntermediaryMenu(int client, int iItemDefinitionIndex, int slot) {
intMenu.AddItem(slotStr, "", ITEMDRAW_IGNORE);

int anyMatch = 0;
if (IsHatUnusual(iItemDefinitionIndex && CV_Cosmetics_Unusuals.BoolValue)) {
if (IsHatUnusual(iItemDefinitionIndex) && CV_Cosmetics_Unusuals.BoolValue) {
int effect = pCosmetics[client].uEffects[slot];

if (effect < 1 || pCosmetics[client].iItemIndex[slot] != iItemDefinitionIndex)
Expand Down
6 changes: 5 additions & 1 deletion scripting/tf2item_weapons.sp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#pragma semicolon 1
#pragma newdecls required

#define PLUGIN_VERSION "3.0.1"
#define PLUGIN_VERSION "3.0.2"

public Plugin myinfo =
{
Expand Down Expand Up @@ -110,6 +110,10 @@ public void OnMapStart() {
HookRespawns();
}

public void OnClientPostAdminCheck(int client) {
pWeapons[client].ResetAll(true);
}

//
// Normal Menus Handlers
////////////////////////
Expand Down
6 changes: 6 additions & 0 deletions scripting/tf2items/tf2item_base.inc
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@
/*
* Change-Log
*
* 3.0.2 - 14/10/21
* tf2item_weapons
* - Fixed a wrongly initialized value for connecting players causing them to recieve a stock bat regardless of class.
* tf2item_cosmetics
* - Fixed Unusual overrides not being added to the menu regardless of ConVar value (parenthesis mistake)
*
* 3.0.1 - 13/10/21
*
* General
Expand Down
5 changes: 3 additions & 2 deletions scripting/tf2items/weapons.sp
Original file line number Diff line number Diff line change
Expand Up @@ -129,9 +129,9 @@ enum struct WeaponsInfo {
* void ResetAll()
* Called to reset everything on the weapon. All is set to -1.
*/
void ResetAll() {
void ResetAll(bool all = false) {
for (int i = 0; i < 3; i++)
this.ResetFor(i);
this.ResetFor(i, all);
}

void ResetFor(int slot, bool resetAll = false) {
Expand All @@ -149,6 +149,7 @@ enum struct WeaponsInfo {
this.kSheen[slot] = -1;
this.kStreaker[slot] = -1;

// Spells are set to 0 bc it's a bitfield
this.sSpells[slot] = 0;

// Do not reset the override if not needed.
Expand Down
24 changes: 13 additions & 11 deletions translations/paintkits.txt
Original file line number Diff line number Diff line change
@@ -1,19 +1,13 @@
"9_0_field { field_number: 2 }" "Red Rock Roscoe"
"9_100_field { field_number: 2 }" "100: (Unused) Red Rock Roscoe"
"9_101_field { field_number: 2 }" "101: (Unused) Sand Cannon"
"9_102_field { field_number: 2 }" "Wrapped Reviver Mk.II"
"9_103_field { field_number: 2 }" "103: (Unused) Psychedelic Slugger"
"9_104_field { field_number: 2 }" "Carpet Bomber Mk.II"
"9_105_field { field_number: 2 }" "Masked Mender Mk.II"
"9_106_field { field_number: 2 }" "Woodland Warrior Mk.II"
"9_107_field { field_number: 2 }" "107: (Unused) Purple Range"
"9_108_field { field_number: 2 }" "108: (Unused) Sudden Flurry"
"9_109_field { field_number: 2 }" "Forest Fire Mk.II"
"9_10_field { field_number: 2 }" "King of the Jungle"
"9_112_field { field_number: 2 }" "Backwoods Boomstick Mk.II"
"9_113_field { field_number: 2 }" "Woodsy Widowmaker Mk.II"
"9_114_field { field_number: 2 }" "Night Owl Mk.II"
"9_117_field { field_number: 2 }" "117: (Unused) Barn Burner"
"9_11_field { field_number: 2 }" "Night Terror"
"9_120_field { field_number: 2 }" "Iron Wood Mk.II"
"9_122_field { field_number: 2 }" "Plaid Potshotter Mk.II"
Expand All @@ -23,8 +17,6 @@
"9_13_field { field_number: 2 }" "Woodsy Widowmaker"
"9_143_field { field_number: 2 }" "Smalltown Bringdown Mk.II"
"9_144_field { field_number: 2 }" "Civic Duty Mk.II"
"9_145_field { field_number: 2 }" "145: (Unused) Liquid Asset"
"9_148_field { field_number: 2 }" "148: (Unused) Pink Elephant"
"9_14_field { field_number: 2 }" "Night Owl"
"9_151_field { field_number: 2 }" "Dead Reckoner Mk.II"
"9_15_field { field_number: 2 }" "Tartan Torpedo"
Expand Down Expand Up @@ -120,7 +112,20 @@
"9_281_field { field_number: 2 }" "Frosty Delivery"
"9_282_field { field_number: 2 }" "Glacial Glazed"
"9_283_field { field_number: 2 }" "Cookie Fortress"
"9_284_field { field_number: 2 }" "Sarsparilla Sprayed"
"9_285_field { field_number: 2 }" "Swashbuckled"
"9_286_field { field_number: 2 }" "Skull Cracked"
"9_287_field { field_number: 2 }" "Misfortunate"
"9_289_field { field_number: 2 }" "Neon-ween"
"9_28_field { field_number: 2 }" "American Pastoral"
"9_290_field { field_number: 2 }" "Simple Spirits"
"9_291_field { field_number: 2 }" "Broken Bones"
"9_292_field { field_number: 2 }" "Potent Poison"
"9_293_field { field_number: 2 }" "Searing Souls"
"9_294_field { field_number: 2 }" "Party Phantoms"
"9_295_field { field_number: 2 }" "Polter-Guised"
"9_296_field { field_number: 2 }" "Kiln & Conquer"
"9_297_field { field_number: 2 }" "Necromanced"
"9_29_field { field_number: 2 }" "Backcountry Blaster"
"9_2_field { field_number: 2 }" "Wrapped Reviver"
"9_300_field { field_number: 2 }" "Yeti Coated"
Expand Down Expand Up @@ -202,7 +207,4 @@
"9_91_field { field_number: 2 }" "Rainbow"
"9_92_field { field_number: 2 }" "Killer Bee"
"9_93_field { field_number: 2 }" "Coffin Nail"
"9_97_field { field_number: 2 }" "97: wearblend"
"9_98_field { field_number: 2 }" "98: dirt/blood/scratches"
"9_99_field { field_number: 2 }" "99: ao/dirt/blood/scratches"
"9_9_field { field_number: 2 }" "Forest Fire"

0 comments on commit 2836cf8

Please sign in to comment.