Skip to content

Commit

Permalink
Merge pull request #387 from OoliteProject/weapon_scripting_context
Browse files Browse the repository at this point in the history
Fix for correct context when adding weapons to player ship
  • Loading branch information
phkb authored Aug 4, 2021
2 parents 31939ba + c8bddc2 commit 84006e2
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/Core/Scripting/OOJSShip.m
Original file line number Diff line number Diff line change
Expand Up @@ -1864,7 +1864,15 @@ static JSBool ShipSetProperty(JSContext *context, JSObject *this, jsid propID, J
facing = [entity currentWeaponFacing];
break;
}
[entity setWeaponMount:facing toWeapon:sValue];
if ([entity isPlayer])
{
PlayerEntity *pent = (PlayerEntity*)entity;
[pent setWeaponMount:facing toWeapon:sValue inContext:@"scripted"];
}
else
{
[entity setWeaponMount:facing toWeapon:sValue];
}
return YES;

case kShip_maxEscorts:
Expand Down

0 comments on commit 84006e2

Please sign in to comment.