Skip to content

Commit

Permalink
NWN2: Add roster status get calls as script functions
Browse files Browse the repository at this point in the history
  • Loading branch information
rjshae authored and DrMcCoy committed Feb 10, 2019
1 parent a3d3334 commit 041f6e2
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/engines/nwn2/script/function_tables.h
Original file line number Diff line number Diff line change
Expand Up @@ -963,8 +963,8 @@ const Functions::FunctionPointer Functions::kFunctionPointers[] = {
{ 822, "AddRosterMemberByTemplate" , 0 },
{ 823, "AddRosterMemberByCharacter" , 0 },
{ 824, "RemoveRosterMember" , 0 },
{ 825, "GetIsRosterMemberAvailable" , 0 },
{ 826, "GetIsRosterMemberSelectable" , 0 },
{ 825, "GetIsRosterMemberAvailable" , &Functions::getIsRosterMemberAvailable },
{ 826, "GetIsRosterMemberSelectable" , &Functions::getIsRosterMemberSelectable },
{ 827, "SetIsRosterMemberSelectable" , 0 },
{ 828, "GetObjectFromRosterName" , 0 },
{ 829, "GetRosterNameFromObject" , 0 },
Expand All @@ -983,7 +983,7 @@ const Functions::FunctionPointer Functions::kFunctionPointers[] = {
{ 842, "SetRosterNPCPartyLimit" , 0 },
{ 843, "GetRosterNPCPartyLimit" , 0 },
{ 844, "SetIsRosterMemberCampaignNPC" , 0 },
{ 845, "GetIsRosterMemberCampaignNPC" , 0 },
{ 845, "GetIsRosterMemberCampaignNPC" , &Functions::getIsRosterMemberCampaignNPC },
{ 846, "GetIsRosterMember" , &Functions::getIsRosterMember },
{ 847, "ShowWorldMap" , 0 },
{ 848, "TriggerEncounter" , 0 },
Expand Down
4 changes: 4 additions & 0 deletions src/engines/nwn2/script/functions.h
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,10 @@ class Functions {
void getFirstRosterMember(Aurora::NWScript::FunctionContext &ctx);
void getNextRosterMember (Aurora::NWScript::FunctionContext &ctx);
void getFactionLeader (Aurora::NWScript::FunctionContext &ctx);

void getIsRosterMemberAvailable (Aurora::NWScript::FunctionContext &ctx);
void getIsRosterMemberCampaignNPC(Aurora::NWScript::FunctionContext &ctx);
void getIsRosterMemberSelectable (Aurora::NWScript::FunctionContext &ctx);
// '---

// .--- Actions, functions_action.cpp
Expand Down
15 changes: 15 additions & 0 deletions src/engines/nwn2/script/functions_roster.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,21 @@ void Functions::getNextRosterMember(Aurora::NWScript::FunctionContext &ctx) {
ctx.getReturn() = _game->getModule().getRoster().getNextRosterMember();
}

void Functions::getIsRosterMemberAvailable(Aurora::NWScript::FunctionContext &ctx) {
const Common::UString &name = ctx.getParams()[0].getString();
ctx.getReturn() = _game->getModule().getRoster().getIsRosterMemberAvailable(name);
}

void Functions::getIsRosterMemberCampaignNPC(Aurora::NWScript::FunctionContext &ctx) {
const Common::UString &name = ctx.getParams()[0].getString();
ctx.getReturn() = _game->getModule().getRoster().getIsRosterMemberCampaignNPC(name);
}

void Functions::getIsRosterMemberSelectable(Aurora::NWScript::FunctionContext &ctx) {
const Common::UString &name = ctx.getParams()[0].getString();
ctx.getReturn() = _game->getModule().getRoster().getIsRosterMemberSelectable(name);
}

} // End of namespace NWN2

} // End of namespace Engines

0 comments on commit 041f6e2

Please sign in to comment.