Skip to content

Commit 5932a59

Browse files
committed
mobsi code cleanup
1 parent 6e3a5b6 commit 5932a59

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

game/world/objects/interactive.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -605,15 +605,15 @@ void Interactive::autoDetachNpc() {
605605
bool Interactive::checkUseConditions(Npc& npc) {
606606
const bool isPlayer = npc.isPlayer();
607607

608-
auto& sc = npc.world().script();
608+
auto& sc = world.script();
609609

610610
if(isPlayer) {
611611
const bool g1 = Gothic::inst().version().game==1;
612-
const size_t ItKE_lockpick = world.script().lockPickId();
612+
const size_t ItKE_lockpick = sc.lockPickId();
613613
const size_t lockPickCnt = npc.inventory().itemCount(ItKE_lockpick);
614614
const bool canLockPick = ((g1 || npc.talentSkill(TALENT_PICKLOCK)!=0) && lockPickCnt>0);
615615

616-
const size_t keyInst = keyInstance.empty() ? size_t(-1) : world.script().findSymbolIndex(keyInstance);
616+
const size_t keyInst = keyInstance.empty() ? size_t(-1) : sc.findSymbolIndex(keyInstance);
617617
const bool needToPicklock = (pickLockStr.size()>0);
618618

619619
if(keyInst!=size_t(-1) && (isLockCracked || npc.itemCount(keyInst)>0)) {
@@ -644,7 +644,7 @@ bool Interactive::checkUseConditions(Npc& npc) {
644644
}
645645

646646
if(!useWithItem.empty()) {
647-
size_t it = world.script().findSymbolIndex(useWithItem);
647+
size_t it = sc.findSymbolIndex(useWithItem);
648648
if(it!=size_t(-1) && npc.itemCount(it)==0) {
649649
sc.printMobMissingItem(npc);
650650
return false;

0 commit comments

Comments
 (0)