diff --git a/Tactical/Item Types.h b/Tactical/Item Types.h
index e1d71ea7..5f64fbe9 100644
--- a/Tactical/Item Types.h
+++ b/Tactical/Item Types.h
@@ -1046,7 +1046,8 @@ typedef struct
BOOLEAN robotremotecontrol;
BOOLEAN camouflagekit;
BOOLEAN locksmithkit;
- BOOLEAN mine;
+ BOOLEAN mine;
+ BOOLEAN antitankmine;
FLOAT alcohol;
BOOLEAN hardware;
BOOLEAN medical;
diff --git a/TileEngine/Explosion Control.cpp b/TileEngine/Explosion Control.cpp
index 32e42f02..05a99c27 100644
--- a/TileEngine/Explosion Control.cpp
+++ b/TileEngine/Explosion Control.cpp
@@ -4529,6 +4529,14 @@ BOOLEAN SetOffBombsInGridNo( UINT8 ubID, INT32 sGridNo, BOOLEAN fAllBombs, INT8
{
if (fAllBombs || (*pObj)[0]->data.misc.bDetonatorType == BOMB_PRESSURE)
{
+ // Flugente: if this is a anti-tank mine, only detonate it if the person triggering it is (in) a vehicle, or if we detonate everything unconditional
+ if ( !fAllBombs && ubID != NOBODY && Item[pObj->usItem].antitankmine )
+ {
+ // if this is not a vehicle, not a robot and not a tank, don't activate
+ if ( !(MercPtrs[ubID]->flags.uiStatusFlags & SOLDIER_VEHICLE) && !AM_A_ROBOT( MercPtrs[ubID] ) && !TANK( MercPtrs[ubID] ) )
+ continue;
+ }
+
// Snap: if we do set off our own trap (e.g. by trying to disarm it), we pay!
/*if (!fAllBombs && MercPtrs[ ubID ]->bTeam != gbPlayerNum )
{
diff --git a/Utils/XML_Items.cpp b/Utils/XML_Items.cpp
index ae8de0ab..a7f98d22 100644
--- a/Utils/XML_Items.cpp
+++ b/Utils/XML_Items.cpp
@@ -209,6 +209,7 @@ itemStartElementHandle(void *userData, const XML_Char *name, const XML_Char **at
strcmp(name, "CamouflageKit") == 0 ||
strcmp(name, "LocksmithKit") == 0 ||
strcmp(name, "Mine") == 0 ||
+ strcmp(name, "antitankmine" ) == 0 ||
strcmp(name, "GasCan") == 0 ||
strcmp(name, "ContainsLiquid") == 0 ||
strcmp(name, "Rock") == 0 ||
@@ -1134,7 +1135,12 @@ itemEndElementHandle(void *userData, const XML_Char *name)
{
pData->curElement = ELEMENT;
pData->curItem.mine = (BOOLEAN) atol(pData->szCharData);
- }
+ }
+ else if ( strcmp( name, "antitankmine" ) == 0 )
+ {
+ pData->curElement = ELEMENT;
+ pData->curItem.antitankmine = (BOOLEAN)atol( pData->szCharData );
+ }
else if(strcmp(name, "GasCan") == 0)
{
pData->curElement = ELEMENT;
@@ -1950,18 +1956,19 @@ BOOLEAN WriteItemStats()
FilePrintf(hFile,"\t\t%d\r\n", Item[cnt].percentapreduction );
FilePrintf(hFile,"\t\t%d\r\n", Item[cnt].percentstatusdrainreduction );
- FilePrintf(hFile,"\t\t%d\r\n", Item[cnt].damagebonus );
+ FilePrintf(hFile,"\t\t%d\r\n", Item[cnt].damagebonus );
FilePrintf(hFile,"\t\t%d\r\n", Item[cnt].meleedamagebonus );
FilePrintf(hFile,"\t\t%d\r\n", Item[cnt].grenadelauncher );
- FilePrintf(hFile,"\t\t%d\r\n", Item[cnt].duckbill );
- FilePrintf(hFile,"\t\t%d\r\n", Item[cnt].glgrenade );
- FilePrintf(hFile,"\t\t%d\r\n", Item[cnt].mine );
- FilePrintf(hFile,"\t\t%d\r\n", Item[cnt].mortar );
- FilePrintf(hFile,"\t\t%d\r\n", Item[cnt].rocketlauncher );
- FilePrintf(hFile,"\t\t%d\r\n", Item[cnt].singleshotrocketlauncher );
- FilePrintf(hFile,"\t\t%d\r\n", Item[cnt].discardedlauncheritem );
- FilePrintf(hFile,"\t\t%d\r\n", Item[cnt].rocketrifle);
- FilePrintf(hFile,"\t\t%d\r\n", Item[cnt].cannon);
+ FilePrintf(hFile,"\t\t%d\r\n", Item[cnt].duckbill );
+ FilePrintf(hFile,"\t\t%d\r\n", Item[cnt].glgrenade );
+ FilePrintf(hFile,"\t\t%d\r\n", Item[cnt].mine );
+ FilePrintf(hFile,"\t\t%d\r\n", Item[cnt].antitankmine );
+ FilePrintf(hFile,"\t\t%d\r\n", Item[cnt].mortar );
+ FilePrintf(hFile,"\t\t%d\r\n", Item[cnt].rocketlauncher );
+ FilePrintf(hFile,"\t\t%d\r\n", Item[cnt].singleshotrocketlauncher );
+ FilePrintf(hFile,"\t\t%d\r\n", Item[cnt].discardedlauncheritem );
+ FilePrintf(hFile,"\t\t%d\r\n", Item[cnt].rocketrifle);
+ FilePrintf(hFile,"\t\t%d\r\n", Item[cnt].cannon);
for(UINT8 cnt2 = 0; cnt2 < MAX_DEFAULT_ATTACHMENTS; cnt2++){
if(Item[cnt].defaultattachments[cnt2] != 0){