mirror of
https://github.com/1dot13/source.git
synced 2026-07-29 13:52:17 +02:00
Fixes by Shadooow:
- fixed queen alternative gridno feature spawning her behind walls in basement instead of in front of the throne in palace - fixed queen alternative gridno feature triggering even when palace was cleared - added missing sanity checks when Climbing/Jumping via UI button git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8961 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
@@ -394,7 +394,7 @@ BOOLEAN SetThisSectorAsPlayerControlled( INT16 sMapX, INT16 sMapY, INT8 bMapZ, B
|
||||
#else
|
||||
|
||||
if( sMapX == gModSettings.ubQueenBasementSectorX && sMapY == gModSettings.ubQueenBasementSectorY
|
||||
&& bMapZ == gModSettings.ubQueenBasementSectorZ )
|
||||
&& bMapZ == gModSettings.ubQueenBasementSectorZ && !SectorInfo[SECTOR(sMapX, sMapY)].fSurfaceWasEverPlayerControlled)
|
||||
{ //Basement sector
|
||||
gfUseAlternateQueenPosition = TRUE;
|
||||
}
|
||||
|
||||
@@ -4626,24 +4626,70 @@ void BtnClimbCallback(GUI_BUTTON *btn,INT32 reason)
|
||||
{
|
||||
btn->uiFlags &= (~BUTTON_CLICKED_ON );
|
||||
|
||||
if (!IsValidStance(gpSMCurrentMerc, ANIM_CROUCH))
|
||||
{
|
||||
if (gpSMCurrentMerc->bCollapsed && gpSMCurrentMerc->bBreath < OKBREATH)
|
||||
{
|
||||
ScreenMsg(FONT_MCOLOR_LTYELLOW, MSG_UI_FEEDBACK, gzLateLocalizedString[4], gpSMCurrentMerc->GetName());
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
GetMercClimbDirection( gpSMCurrentMerc->ubID, &fNearLowerLevel, &fNearHeigherLevel );
|
||||
|
||||
if ( fNearLowerLevel )
|
||||
{
|
||||
gpSMCurrentMerc->BeginSoldierClimbDownRoof( );
|
||||
if ((UsingNewInventorySystem() == true) && gpSMCurrentMerc->inv[BPACKPOCKPOS].exists() == true
|
||||
//JMich.BackpackClimb
|
||||
&& ((gGameExternalOptions.sBackpackWeightToClimb == -1) || (INT16)gpSMCurrentMerc->inv[BPACKPOCKPOS].GetWeightOfObjectInStack() + Item[gpSMCurrentMerc->inv[BPACKPOCKPOS].usItem].sBackpackWeightModifier > gGameExternalOptions.sBackpackWeightToClimb)
|
||||
&& ((gGameExternalOptions.fUseGlobalBackpackSettings == TRUE) || (Item[gpSMCurrentMerc->inv[BPACKPOCKPOS].usItem].fAllowClimbing == FALSE)))
|
||||
{
|
||||
ScreenMsg(FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, NewInvMessage[NIV_NO_CLIMB]);
|
||||
return;
|
||||
}
|
||||
|
||||
if (EnoughPoints(gpSMCurrentMerc, GetAPsToClimbRoof(gpSMCurrentMerc, TRUE), GetBPsToClimbRoof(gpSMCurrentMerc, TRUE), FALSE))
|
||||
{
|
||||
gpSMCurrentMerc->BeginSoldierClimbDownRoof();
|
||||
}
|
||||
}
|
||||
|
||||
if ( fNearHeigherLevel )
|
||||
{
|
||||
gpSMCurrentMerc->BeginSoldierClimbUpRoof( );
|
||||
if ((UsingNewInventorySystem() == true) && gpSMCurrentMerc->inv[BPACKPOCKPOS].exists() == true
|
||||
//JMich.BackpackClimb
|
||||
&& ((gGameExternalOptions.sBackpackWeightToClimb == -1) || (INT16)gpSMCurrentMerc->inv[BPACKPOCKPOS].GetWeightOfObjectInStack() + Item[gpSMCurrentMerc->inv[BPACKPOCKPOS].usItem].sBackpackWeightModifier > gGameExternalOptions.sBackpackWeightToClimb)
|
||||
&& ((gGameExternalOptions.fUseGlobalBackpackSettings == TRUE) || (Item[gpSMCurrentMerc->inv[BPACKPOCKPOS].usItem].fAllowClimbing == FALSE)))
|
||||
{
|
||||
ScreenMsg(FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, NewInvMessage[NIV_NO_CLIMB]);
|
||||
return;
|
||||
}
|
||||
|
||||
if (EnoughPoints(gpSMCurrentMerc, GetAPsToClimbRoof(gpSMCurrentMerc, FALSE), GetBPsToClimbRoof(gpSMCurrentMerc, FALSE), FALSE))
|
||||
{
|
||||
gpSMCurrentMerc->BeginSoldierClimbUpRoof();
|
||||
}
|
||||
}
|
||||
|
||||
//---------------Legion by JAzz-----------
|
||||
|
||||
if (gGameExternalOptions.fCanClimbOnWalls == TRUE)
|
||||
{
|
||||
{
|
||||
if ((UsingNewInventorySystem() == true) && gpSMCurrentMerc->inv[BPACKPOCKPOS].exists() == true
|
||||
//JMich.BackpackClimb
|
||||
&& ((gGameExternalOptions.sBackpackWeightToClimb == -1) || (INT16)gpSMCurrentMerc->inv[BPACKPOCKPOS].GetWeightOfObjectInStack() + Item[gpSMCurrentMerc->inv[BPACKPOCKPOS].usItem].sBackpackWeightModifier > gGameExternalOptions.sBackpackWeightToClimb)
|
||||
&& ((gGameExternalOptions.fUseGlobalBackpackSettings == TRUE) || (Item[gpSMCurrentMerc->inv[BPACKPOCKPOS].usItem].fAllowClimbing == FALSE)))
|
||||
{
|
||||
ScreenMsg(FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, NewInvMessage[NIV_NO_CLIMB]);
|
||||
return;
|
||||
}
|
||||
|
||||
if ( FindWallJumpDirection( gpSMCurrentMerc, gpSMCurrentMerc->sGridNo, gpSMCurrentMerc->ubDirection, &bDirection ) )
|
||||
{
|
||||
gpSMCurrentMerc->BeginSoldierClimbWall( );
|
||||
if (EnoughPoints(gpSMCurrentMerc, GetAPsToJumpWall(gpSMCurrentMerc, FALSE), GetBPsToJumpWall(gpSMCurrentMerc, FALSE), FALSE))
|
||||
{
|
||||
gpSMCurrentMerc->BeginSoldierClimbWall();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4651,7 +4697,19 @@ void BtnClimbCallback(GUI_BUTTON *btn,INT32 reason)
|
||||
|
||||
if ( FindFenceJumpDirection( gpSMCurrentMerc, gpSMCurrentMerc->sGridNo, gpSMCurrentMerc->ubDirection, &bDirection ) )
|
||||
{
|
||||
gpSMCurrentMerc->BeginSoldierClimbFence( );
|
||||
if ((UsingNewInventorySystem() == true) && gpSMCurrentMerc->inv[BPACKPOCKPOS].exists() == true
|
||||
//JMich.BackpackClimb
|
||||
&& ((gGameExternalOptions.sBackpackWeightToClimb == -1) || (INT16)gpSMCurrentMerc->inv[BPACKPOCKPOS].GetWeightOfObjectInStack() + Item[gpSMCurrentMerc->inv[BPACKPOCKPOS].usItem].sBackpackWeightModifier > gGameExternalOptions.sBackpackWeightToClimb)
|
||||
&& ((gGameExternalOptions.fUseGlobalBackpackSettings == TRUE) || (Item[gpSMCurrentMerc->inv[BPACKPOCKPOS].usItem].fAllowClimbing == FALSE)))
|
||||
{
|
||||
ScreenMsg(FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, NewInvMessage[NIV_NO_CLIMB]);
|
||||
return;
|
||||
}
|
||||
|
||||
if (EnoughPoints(gpSMCurrentMerc, GetAPsToJumpFence(gpSMCurrentMerc, FALSE), GetBPsToJumpFence(gpSMCurrentMerc, FALSE), FALSE))
|
||||
{
|
||||
gpSMCurrentMerc->BeginSoldierClimbFence();
|
||||
}
|
||||
}
|
||||
}
|
||||
else if(reason & MSYS_CALLBACK_REASON_LOST_MOUSE )
|
||||
|
||||
@@ -737,6 +737,7 @@ BOOLEAN AddPlacementToWorld( SOLDIERINITNODE *curr, GROUP *pGroup = NULL )
|
||||
if( gfUseAlternateQueenPosition && tempDetailedPlacement.ubProfile == QUEEN )
|
||||
{
|
||||
tempDetailedPlacement.sInsertionGridNo = gModSettings.iQueenAlternateGridNo;//dnl!!!
|
||||
tempDetailedPlacement.bSectorZ = 0;
|
||||
}
|
||||
if( tempDetailedPlacement.ubCivilianGroup != QUEENS_CIV_GROUP )
|
||||
{ //The free civilians aren't added if queen is alive
|
||||
|
||||
Reference in New Issue
Block a user