Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ability to match against leg armor attachments #96

Merged
merged 1 commit into from
Jan 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions Tactical/LogicalBodyTypes/Filter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,18 @@ bool Filter::Match(SOLDIERTYPE* pSoldier) {
case REQ_HELMETPOSATTACHMENT3:
cmp_val = CompareAttachment(pSoldier, HELMETPOS, 3);
break;
case REQ_LEGPOSATTACHMENT0:
cmp_val = CompareAttachment(pSoldier, LEGPOS, 0);
break;
case REQ_LEGPOSATTACHMENT1:
cmp_val = CompareAttachment(pSoldier, LEGPOS, 1);
break;
case REQ_LEGPOSATTACHMENT2:
cmp_val = CompareAttachment(pSoldier, LEGPOS, 2);
break;
case REQ_LEGPOSATTACHMENT3:
cmp_val = CompareAttachment(pSoldier, LEGPOS, 3);
break;
default:
if (q < NUM_REQTYPESINV) {
cmp_val = pSoldier->inv[q].usItem;
Expand Down
4 changes: 4 additions & 0 deletions Tactical/LogicalBodyTypes/Filter.h
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,10 @@ class Filter {
REQ_HELMETPOSATTACHMENT1,
REQ_HELMETPOSATTACHMENT2,
REQ_HELMETPOSATTACHMENT3,
REQ_LEGPOSATTACHMENT0,
REQ_LEGPOSATTACHMENT1,
REQ_LEGPOSATTACHMENT2,
REQ_LEGPOSATTACHMENT3,
NUM_REQTYPES,
// 3rd byte is for operator flags
_REQ_BTWN = 0x20000,
Expand Down
8 changes: 6 additions & 2 deletions Tactical/LogicalBodyTypes/FilterDB.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ namespace LogicalBodyTypes {
/*****************************************
Filter enum criterion types
******************************************/
LOGBT_ENUMDB_ADD("IntegerFilterCriterionTypes", 37,
LOGBT_ENUMDB_ADD("IntegerFilterCriterionTypes", 41,
Filter::REQ_HELMETPOS,
Filter::REQ_VESTPOS,
Filter::REQ_LEGPOS,
Expand Down Expand Up @@ -307,7 +307,11 @@ namespace LogicalBodyTypes {
Filter::REQ_HELMETPOSATTACHMENT0,
Filter::REQ_HELMETPOSATTACHMENT1,
Filter::REQ_HELMETPOSATTACHMENT2,
Filter::REQ_HELMETPOSATTACHMENT3
Filter::REQ_HELMETPOSATTACHMENT3,
Filter::REQ_LEGPOSATTACHMENT0,
Filter::REQ_LEGPOSATTACHMENT1,
Filter::REQ_LEGPOSATTACHMENT2,
Filter::REQ_LEGPOSATTACHMENT3
);

/*****************************************
Expand Down