@@ -1835,7 +1835,7 @@ void CAdvMapInt::keyPressed(const SDL_KeyboardEvent & key)
case SDLK_d:
{
const CGHeroInstance *h = dynamic_cast<const CGHeroInstance*>(selection);
- if(h && isActive())
+ if(h && isActive() && key.state == SDL_PRESSED)
LOCPLINT->tryDiggging(h);
return;
}
@@ -1947,8 +1947,9 @@ void CPlayerInterface::tryDiggging(const CGHeroInstance *h)
showInfoDialog(CGI->generaltexth->allTexts[60]); //Try looking on land!
else
+ const TerrainTile *t = cb->getTileInfo(h->getPosition());
CGI->mh->getTerrainDescr(h->getPosition(false), hlp, false);
- if(hlp.length())
+ if(hlp.length() || t->blockingObjects.size() > 1)
showInfoDialog(CGI->generaltexth->allTexts[97]); //Try searching on clear ground.
cb->dig(h);
@@ -42,7 +42,7 @@ Graphics * graphics = NULL;
SDL_Surface * Graphics::drawHeroInfoWin(const InfoAboutHero &curh)
- char buf[10];
+ char buf[15];
blueToPlayersAdv(hInfo,curh.owner);
SDL_Surface * ret = SDL_DisplayFormat(hInfo);
SDL_SetColorKey(ret,SDL_SRCCOLORKEY,SDL_MapRGB(ret->format,0,255,255));
@@ -21,7 +21,7 @@ typedef boost::int8_t si8; //signed int 8 bits (1 byte)
#define THC
#endif
-#define NAME_VER ("VCMI 0.8")
+#define NAME_VER ("VCMI 0.80")
extern std::string NAME; //full name
extern std::string NAME_AFFIX; //client / server
#define CONSOLE_LOGGING_LEVEL 5
@@ -1085,6 +1085,9 @@ SDL_Surface * CMapHandler::getVisBitmap(int x, int y, const std::vector< std::ve
bool CMapHandler::printObject(const CGObjectInstance *obj)
+ if(!obj->defInfo->handler)
+ processDef(obj->defInfo);
+
const SDL_Surface *bitmap = obj->defInfo->handler->ourImages[0].bitmap;
int tilesW = bitmap->w/32,
tilesH = bitmap->h/32;
@@ -4030,7 +4030,7 @@ bool CGameHandler::dig( const CGHeroInstance *h )
for (std::vector<CGObjectInstance*>::const_iterator i = gs->map->objects.begin(); i != gs->map->objects.end(); i++) //unflag objs
- if((*i)->ID == 124 && (*i)->pos == h->getPosition())
+ if(*i && (*i)->ID == 124 && (*i)->pos == h->getPosition())
complain("Cannot dig - there is already a hole under the hero!");
return false;