Skip to content

Commit

Permalink
noClickThrough tag to fix unreachable top level of shelf / apple tree…
Browse files Browse the repository at this point in the history
…s etc
  • Loading branch information
risvh committed Feb 27, 2024
1 parent 2451853 commit 4feef8c
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 1 deletion.
4 changes: 3 additions & 1 deletion gameSource/LivingLifePage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21752,7 +21752,9 @@ void LivingLifePage::checkForPointerHit( PointerHitRecord *inRecord,
// AND this object is tall
// (don't click through short behind short)
if( p->hitOurPlacement &&
getObjectHeight( oID ) > .75 * CELL_D ) {
getObjectHeight( oID ) > .75 * CELL_D &&
!obj->noClickThrough // object prevents click-through
) {

if( p->closestCellY > y ) {
p->hitOurPlacementBehind = true;
Expand Down
13 changes: 13 additions & 0 deletions gameSource/objectBank.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -577,6 +577,15 @@ static void setupNoHighlight( ObjectRecord *inR ) {
inR->noHighlight = true;
}
}


static void setupNoClickThrough( ObjectRecord *inR ) {
inR->noClickThrough = false;

if( strstr( inR->description, "+noClickThrough" ) != NULL ) {
inR->noClickThrough = true;
}
}



Expand Down Expand Up @@ -796,6 +805,8 @@ float initObjectBankStep() {

setupNoHighlight( r );

setupNoClickThrough( r );

setupMaxPickupAge( r );

setupAutoDefaultTrans( r );
Expand Down Expand Up @@ -3660,6 +3671,8 @@ int addObject( const char *inDescription,
setupOwned( r );

setupNoHighlight( r );

setupNoClickThrough( r );

setupMaxPickupAge( r );

Expand Down
4 changes: 4 additions & 0 deletions gameSource/objectBank.h
Original file line number Diff line number Diff line change
Expand Up @@ -414,6 +414,10 @@ typedef struct ObjectRecord {

char noHighlight;

// tall objects can be clicked through to reach small objects behind
// this property disables that
char noClickThrough;

// for auto-orienting fences, walls, etc
// all three objects know the IDs of all three objects
int horizontalVersionID;
Expand Down

0 comments on commit 4feef8c

Please sign in to comment.