MantisBT

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0001985VCMIMechanics - Objectspublic2014-12-07 07:282014-12-22 09:47
ReporterSXX 
Assigned ToSXX 
PrioritynormalSeveritycrashReproducibilityalways
StatusclosedResolutionfixed 
PlatformOSOS Version
Product Version0.97 
Target VersionFixed in Version0.97b 
Summary0001985: Cartographer: attempt of tunnels reveal on map without underground cause server crash
DescriptionIn process of creating my testing map find out that such behaviour will cause crash while in vanilla heroes nothing would happen.

CCartographer::blockingDialogAnswered or CPrivilagedInfoCallback::getAllTiles need appropriate check if underground level exists or not.

Will try to fix it on my own.
Steps To Reproduce  - Start game on attached map.
  - Go to cartographer.
  - Agree to buy a map.
TagsNo tags attached.
Attached Files? file icon testCart.h3m [^] (4,984 bytes) 2014-12-07 07:28
txt file icon tunnelMapCrash_GDB_backtrace.txt [^] (2,725 bytes) 2014-12-07 07:28 [Show Content]

- Relationships
related to 0001986closedSXX Cartographers of same type not marked as visited after one of them visited 

-  Notes
(0005198)
SXX (administrator)
2014-12-07 08:39

So easy way to bypass the crash would be just add such check to "CCartographer::blockingDialogAnswered":
void CCartographer::blockingDialogAnswered(const CGHeroInstance *hero, ui32 answer) const
{
    if(subID == 2 && !cb->gameState()->map->twoLevel)
        return;

So player won't lose any gold, building just would do nothing.

Though in vanilla Heroes 3 behaviour is different:

  - Cartographer building marked as visited.
  - Player lose 1000 gold.

Is there reason to stick to how it's work in vanilla, solution above would work or there need to be some better fix for such situation?
(0005199)
Warmonger (administrator)
2014-12-07 09:20

IMO Cartographer which can't reveal anything should be marked as visited, but don't take away gold from player for nothing.
(0005202)
SXX (administrator)
2014-12-07 10:52

Do you think it's should show dialog about map purchase at all?
Then if player agree don't take any gold and just mark it as visited?

...

Also in vanilla underground cartographer looks broken (do nothing) and land one reveal everything except water on both underground and ground layers. So VCMI works more correctly here.

PS: Find out other wrong behaviour and posted as 0001985
(0005203)
Warmonger (administrator)
2014-12-07 11:34

If Cartographer cannot work correctly, it should display "visited" message on first hero visit and don't make any offer.
(0005209)
SXX (administrator)
2014-12-09 11:11

Pull request:
https://github.com/vcmi/vcmi/pull/64 [^]

Few other improvements for Cartographer will be in separate pull requests as they're break saves.

- Issue History
Date Modified Username Field Change
2014-12-07 07:28 SXX New Issue
2014-12-07 07:28 SXX Status new => assigned
2014-12-07 07:28 SXX Assigned To => SXX
2014-12-07 07:28 SXX File Added: testCart.h3m
2014-12-07 07:28 SXX File Added: tunnelMapCrash_GDB_backtrace.txt
2014-12-07 08:39 SXX Note Added: 0005198
2014-12-07 09:20 Warmonger Note Added: 0005199
2014-12-07 10:50 SXX Relationship added related to 0001986
2014-12-07 10:52 SXX Note Added: 0005202
2014-12-07 10:52 SXX Category Mechanics - Adventure Map => Mechanics - Objects
2014-12-07 11:34 Warmonger Note Added: 0005203
2014-12-09 11:11 SXX Note Added: 0005209
2014-12-09 12:50 SXX Status assigned => resolved
2014-12-09 12:50 SXX Fixed in Version => 0.97b
2014-12-09 12:50 SXX Resolution open => fixed
2014-12-22 09:47 SXX Status resolved => closed

Site | Forums | Wiki | Slack | GitHub


Copyright © 2000 - 2024 MantisBT Team
Hosting provided by DigitalOcean