Skip to content

Commit

Permalink
Model filter:
Browse files Browse the repository at this point in the history
Copy (or link) both files individually to ensure that their destination name is correct. (E.g. "filtered/filtered.mdl" instead of "filtered/helmet.mdl".
Model folder needs to be made on Linux, not linked.

#2
  • Loading branch information
Adambean committed Sep 10, 2021
1 parent cb4bcf5 commit 0acfb80
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
3 changes: 2 additions & 1 deletion deploy.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,8 @@ IF EXIST "!FILTER_PLAYER_MODELS_FILE_PATHNAME!" (
MD "!FILTER_PLAYER_MODEL_ADDON_DIR_PATHNAME!"
)

COPY /V /Y "!REPLACEMENT_PLAYER_MODEL_DIR_PATHNAME!\"* "!FILTER_PLAYER_MODEL_ADDON_DIR_PATHNAME!" 1>NUL
COPY /V /Y "!REPLACEMENT_PLAYER_MODEL_DIR_PATHNAME!\!REPLACEMENT_PLAYER_MODEL_NAME!.mdl" "!FILTER_PLAYER_MODEL_ADDON_DIR_PATHNAME!\%%L.mdl" 1>NUL
COPY /V /Y "!REPLACEMENT_PLAYER_MODEL_DIR_PATHNAME!\!REPLACEMENT_PLAYER_MODEL_NAME!.bmp" "!FILTER_PLAYER_MODEL_ADDON_DIR_PATHNAME!\%%L.bmp" 1>NUL

ECHO - Filter installed.

Expand Down
16 changes: 8 additions & 8 deletions deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -171,16 +171,16 @@ if [ -f "${FILTER_PLAYER_MODELS_FILE_PATHNAME}" ]; then
rm -rf "${FILTER_PLAYER_MODEL_DOWNLOADS_DIR_PATHNAME}"
fi

if [ "${PLATFORM}" == "Windows" ]; then
if [ ! -d "${FILTER_PLAYER_MODEL_ADDON_DIR_PATHNAME}" ]; then
mkdir -p "${FILTER_PLAYER_MODEL_ADDON_DIR_PATHNAME}"
fi
if [ ! -d "${FILTER_PLAYER_MODEL_ADDON_DIR_PATHNAME}" ]; then
mkdir -p "${FILTER_PLAYER_MODEL_ADDON_DIR_PATHNAME}"
fi

find "${REPLACEMENT_PLAYER_MODEL_DIR_PATHNAME}" -type f | sort | while read REPLACEMENT_PLAYER_MODEL_FILE_PATHNAME; do
cp "${REPLACEMENT_PLAYER_MODEL_FILE_PATHNAME}" "${FILTER_PLAYER_MODEL_ADDON_DIR_PATHNAME}/"
done
if [ "${PLATFORM}" == "Windows" ]; then
cp "${REPLACEMENT_PLAYER_MODEL_DIR_PATHNAME}/${REPLACEMENT_PLAYER_MODEL_NAME}.mdl" "${FILTER_PLAYER_MODEL_ADDON_DIR_PATHNAME}/${FILTER_PLAYER_MODEL_NAME}.mdl"
cp "${REPLACEMENT_PLAYER_MODEL_DIR_PATHNAME}/${REPLACEMENT_PLAYER_MODEL_NAME}.bmp" "${FILTER_PLAYER_MODEL_ADDON_DIR_PATHNAME}/${FILTER_PLAYER_MODEL_NAME}.bmp"
else
ln -s "${REPLACEMENT_PLAYER_MODEL_FILE_PATHNAME}" "${FILTER_PLAYER_MODEL_ADDON_DIR_PATHNAME}"
ln -s "${REPLACEMENT_PLAYER_MODEL_DIR_PATHNAME}/${REPLACEMENT_PLAYER_MODEL_NAME}.mdl" "${FILTER_PLAYER_MODEL_ADDON_DIR_PATHNAME}/${FILTER_PLAYER_MODEL_NAME}.mdl"
ln -s "${REPLACEMENT_PLAYER_MODEL_DIR_PATHNAME}/${REPLACEMENT_PLAYER_MODEL_NAME}.bmp" "${FILTER_PLAYER_MODEL_ADDON_DIR_PATHNAME}/${FILTER_PLAYER_MODEL_NAME}.bmp"
fi

printf " - Filter installed.\n"
Expand Down

0 comments on commit 0acfb80

Please sign in to comment.