diff --git a/.vscode/extensions.json b/.vscode/extensions.json new file mode 100644 index 00000000..b4492766 --- /dev/null +++ b/.vscode/extensions.json @@ -0,0 +1,5 @@ +{ + "recommendations": [ + "klippy.amxxpawn-language" + ] +} \ No newline at end of file diff --git a/LICENSE b/LICENSE new file mode 100644 index 00000000..5ccd6236 --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2022 Hedgehog Fog + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/README.md b/README.md index 5aec2356..d60c624b 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ ![Alt Text](./images/demo.gif) ## πŸŽƒ Halloween Mod πŸ‡ΊπŸ‡¦ ![GitHub package.json version](https://img.shields.io/github/package-json/v/hedgefog/cs-halloween-mod) -![GitHub Workflow Status](https://img.shields.io/github/workflow/status/hedgefog/cs-halloween-mod/CI) +![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/hedgefog/cs-halloween-mod/build.yml?branch=release) ![GitHub release (latest by date)](https://img.shields.io/github/v/release/hedgefog/cs-halloween-mod) ![GitHub all releases](https://img.shields.io/github/downloads/hedgefog/cs-halloween-mod/total) @@ -12,9 +12,10 @@ __Halloween Mod__ is a powerful Halloween-themed core for your __Counter-Strike_ - [Releases](./releases) ### πŸ”„ Requirements -- Amx Mod X 1.8.2+ -- RegameDLL + ReAPI or RoundControl -- Metamod-R or Metamod-P (for windows) +- [Metamod-R](https://github.com/theAsmodai/metamod-r) + [ReHLDS](https://github.com/dreamstalker/rehlds) or [Metamod-P](https://github.com/Bots-United/metamod-p) +- [RegameDLL](https://github.com/s1lentq/ReGameDLL_CS) +- [Amx Mod X 1.8.2+](https://www.amxmodx.org/downloads-new.php) +- [ReAPI](https://github.com/s1lentq/reapi) ### πŸ“– Documentation - [Index](./doc/pages/index.md) diff --git a/package-lock.json b/package-lock.json index c3b3456a..8abc57d6 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "halloween-mod", - "version": "6.4.1", + "version": "6.4.2", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "halloween-mod", - "version": "6.4.1", + "version": "6.4.2", "hasInstallScript": true, "license": "MIT", "devDependencies": { @@ -1300,13 +1300,22 @@ } }, "node_modules/copy-props": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/copy-props/-/copy-props-2.0.4.tgz", - "integrity": "sha512-7cjuUME+p+S3HZlbllgsn2CDwS+5eCCX16qBgNC4jgSTf49qR1VKy/Zhl400m0IQXl/bPGEVqncgUUMjrr4s8A==", + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/copy-props/-/copy-props-2.0.5.tgz", + "integrity": "sha512-XBlx8HSqrT0ObQwmSzM7WE5k8FxTV75h1DX1Z3n6NhQ/UYYAvInWYmG06vFt7hQZArE2fuO62aihiWIVQwh1sw==", "dev": true, "dependencies": { - "each-props": "^1.3.0", - "is-plain-object": "^2.0.1" + "each-props": "^1.3.2", + "is-plain-object": "^5.0.0" + } + }, + "node_modules/copy-props/node_modules/is-plain-object": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-5.0.0.tgz", + "integrity": "sha512-VRSzKkbMm5jMDoKLbltAkFQ5Qr7VDiTFGXxYFXXowVj387GeGNOCsOH6Msy00SGZ3Fp84b1Naa1psqgcCIEP5Q==", + "dev": true, + "engines": { + "node": ">=0.10.0" } }, "node_modules/core-util-is": { @@ -2257,7 +2266,7 @@ "version": "1.2.13", "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-1.2.13.tgz", "integrity": "sha512-oWb1Z6mkHIskLzEJ/XWX0srkpkTQ7vaopMQkyaEIoq0fmtFVxOthb8cCxeT+p3ynTdkk/RZwbgG4brR5BeWECw==", - "deprecated": "fsevents 1 will break on node v14+ and could be using insecure binaries. Upgrade to fsevents 2.", + "deprecated": "The v1 package contains DANGEROUS / INSECURE binaries. Upgrade to safe fsevents v2", "dev": true, "hasInstallScript": true, "optional": true, @@ -3992,9 +4001,9 @@ } }, "node_modules/path-parse": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.6.tgz", - "integrity": "sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw==", + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz", + "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==", "dev": true }, "node_modules/path-root": { @@ -6514,13 +6523,21 @@ "dev": true }, "copy-props": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/copy-props/-/copy-props-2.0.4.tgz", - "integrity": "sha512-7cjuUME+p+S3HZlbllgsn2CDwS+5eCCX16qBgNC4jgSTf49qR1VKy/Zhl400m0IQXl/bPGEVqncgUUMjrr4s8A==", + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/copy-props/-/copy-props-2.0.5.tgz", + "integrity": "sha512-XBlx8HSqrT0ObQwmSzM7WE5k8FxTV75h1DX1Z3n6NhQ/UYYAvInWYmG06vFt7hQZArE2fuO62aihiWIVQwh1sw==", "dev": true, "requires": { - "each-props": "^1.3.0", - "is-plain-object": "^2.0.1" + "each-props": "^1.3.2", + "is-plain-object": "^5.0.0" + }, + "dependencies": { + "is-plain-object": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-5.0.0.tgz", + "integrity": "sha512-VRSzKkbMm5jMDoKLbltAkFQ5Qr7VDiTFGXxYFXXowVj387GeGNOCsOH6Msy00SGZ3Fp84b1Naa1psqgcCIEP5Q==", + "dev": true + } } }, "core-util-is": { @@ -8657,9 +8674,9 @@ "dev": true }, "path-parse": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.6.tgz", - "integrity": "sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw==", + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz", + "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==", "dev": true }, "path-root": { diff --git a/package.json b/package.json index b64701c0..97b7aad1 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "halloween-mod", - "version": "6.4.1", + "version": "6.4.2", "description": "Halloween Mod", "scripts": { "build": "npm run build:vanilla && npm run build:reapi", diff --git a/src/include/hwn.inc b/src/include/hwn.inc index 78d201a6..663b143b 100644 --- a/src/include/hwn.inc +++ b/src/include/hwn.inc @@ -1,4 +1,8 @@ /* + 6.4.2 + Fixes: + Fixed objective marks spawn + 6.4.1 Fixes: Fixed HHH NPC pathfinding @@ -341,7 +345,7 @@ #define HWN_COLOR_SECONDARY HWN_COLOR_GREEN_DARK #define HWN_TITLE "Halloween Mod" -#define HWN_VERSION "6.4.1" +#define HWN_VERSION "6.4.2" enum _:Hwn_PumpkinType { diff --git a/src/scripts/extra/hwn_objective_marks.sma b/src/scripts/extra/hwn_objective_marks.sma index ce975fb2..997d002b 100644 --- a/src/scripts/extra/hwn_objective_marks.sma +++ b/src/scripts/extra/hwn_objective_marks.sma @@ -58,9 +58,10 @@ new g_iszInfoTargetClassname; public plugin_precache() { g_irgMarks = ArrayCreate(_, MAX_PLAYER_MARKS); g_iMarkModelIndex = precache_model("sprites/hwn/mark_cauldron.spr"); + g_iszInfoTargetClassname = engfunc(EngFunc_AllocString, "info_target"); CE_RegisterHook(CEFunction_Spawn, "hwn_bucket", "OnBucketSpawn_Post"); - g_iszInfoTargetClassname = engfunc(EngFunc_AllocString, "info_target"); + CE_RegisterHook(CEFunction_Remove, "hwn_bucket", "OnBucketRemove_Post"); } public plugin_init() { @@ -85,9 +86,17 @@ public OnBucketSpawn_Post(pEntity) { return; } - new pMark = CreateMark(pEntity); - set_pev(pMark, pev_iuser1, ArraySize(g_irgMarks)); - ArrayPushCell(g_irgMarks, pMark); + if (!pev(pEntity, pev_euser1)) { + new pMark = CreateMark(pEntity); + set_pev(pEntity, pev_euser1, pMark); + } +} + +public OnBucketRemove_Post(pEntity) { + new pMark = pev(pEntity, pev_euser1); + if (pMark > 0) { + DestroyMark(pMark); + } } public OnPlayerSpawn_Post(pPlayer) { @@ -199,8 +208,9 @@ public OnCheckVisibility(pEntity) { return FMRES_SUPERCEDE; } -CreateMark(pButton) { +CreateMark(pEntity) { new pMark = engfunc(EngFunc_CreateNamedEntity, g_iszInfoTargetClassname); + new iMarkIndex = ArraySize(g_irgMarks); set_pev(pMark, pev_classname, MARK_CLASSNAME); set_pev(pMark, pev_scale, SPRITE_SCALE); @@ -210,17 +220,38 @@ CreateMark(pButton) { set_pev(pMark, pev_movetype, MOVETYPE_FLYMISSILE); set_pev(pMark, pev_solid, SOLID_NOT); set_pev(pMark, pev_spawnflags, SF_SPRITE_STARTON); - set_pev(pMark, pev_owner, pButton); + set_pev(pMark, pev_owner, pEntity); + set_pev(pMark, pev_iuser1, iMarkIndex); dllfunc(DLLFunc_Spawn, pMark); static Float:vecOrigin[3]; - ExecuteHam(Ham_BodyTarget, pButton, 0, vecOrigin); + ExecuteHam(Ham_BodyTarget, pEntity, 0, vecOrigin); engfunc(EngFunc_SetOrigin, pMark, vecOrigin); + ArrayPushCell(g_irgMarks, pMark); + return pMark; } +DestroyMark(pMark) { + new iMarkIndex = pev(pMark, pev_iuser1); + + set_pev(pMark, pev_flags, pev(pMark, pev_flags) | FL_KILLME); + dllfunc(DLLFunc_Think, pMark); + + ArrayDeleteItem(g_irgMarks, iMarkIndex); + ReindexMarks(); +} + +ReindexMarks() { + new iMarkCount = ArraySize(g_irgMarks); + for (new iMarkIndex = 0; iMarkIndex < iMarkCount; ++iMarkIndex) { + new pMark = ArrayGetCell(g_irgMarks, iMarkIndex); + set_pev(pMark, pev_iuser1, iMarkIndex); + } +} + CalculateMark(pMark, pPlayer) { new iMarkIndex = pev(pMark, pev_iuser1); new Float:flDelta = get_gametime() - g_rgPlayerData[pPlayer][iMarkIndex][Player_MarkUpdateTime];