-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathUselessMine.cpp
More file actions
693 lines (558 loc) · 22.5 KB
/
Copy pathUselessMine.cpp
File metadata and controls
693 lines (558 loc) · 22.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
/*
Copyright (C) 2013-2018 Vladimir "allejo" Jimenez
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the “Software”), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/
#include <algorithm>
#include <functional>
#include <map>
#include "bzfsAPI.h"
#include "plugin_files.h"
const int DEBUG_VERBOSITY = 4;
// Define plugin name
const std::string PLUGIN_NAME = "Useless Mine";
// Define plugin version numbering
const int MAJOR = 1;
const int MINOR = 2;
const int REV = 1;
const int BUILD = 99;
enum class ExplosionType
{
Unknown = -1, // An explosion happened and I don't know why
Mine = 0, // ...happened because of a mine
Defusal // ...happened because of a bomb defusal
};
class UselessMine : public bz_Plugin, public bz_CustomSlashCommandHandler
{
public:
virtual const char* Name();
virtual void Init(const char* config);
virtual void Event(bz_EventData *eventData);
virtual void Cleanup(void);
virtual bool SlashCommand(int, bz_ApiString, bz_ApiString, bz_APIStringList*);
typedef std::multimap< int, std::string, std::greater<int> > rmap;
// The information each mine will contain
struct Mine
{
static const char* ww_shotType;
static const char* ww_shotOwner;
static const char* ww_mineOwner;
bz_ApiString uid; // A unique ID for mine
int owner; // The owner of the mine
int defuserID; // The player who defused this mine
uint32_t detonationShotID; // The GUID of the server shot, whether it's
float x, y, z; // The coordinates of where the mine was placed
bz_eTeamType team; // The team of the mine owner
bool defused; // True if the mine was defused with a Bomb Defusal flag
bool detonated; // True if the mine was detonated by a player
Mine(int _owner, float _pos[3], bz_eTeamType _team) :
owner(_owner),
defuserID(-1),
x(_pos[0]),
y(_pos[1]),
z(_pos[2]),
team(_team),
defused(false),
detonated(false)
{
uid.format("%d_%d_%d", owner, bz_getCurrentTime(), rand() % 32);
}
bool isStale()
{
return (defused || detonated);
}
// Should a given player trigger this mine?
// This function checks mine ownership, team loyalty, player's location and player's alive-ness
bool canPlayerTriggerMine(bz_BasePlayerRecord *pr, float pos[3])
{
if (owner != pr->playerID && (pr->team == eRogueTeam || pr->team != team || bz_getGameType() == eOpenFFAGame) && pr->spawned)
{
float playerPos[3] = {pos[0], pos[1], pos[2]};
double shockRange = bz_getBZDBDouble("_shockOutRadius") * 0.75;
// Check if the player is in the detonation range
bool inDetonationRange = ((playerPos[0] > x - shockRange && playerPos[0] < x + shockRange) &&
(playerPos[1] > y - shockRange && playerPos[1] < y + shockRange) &&
(playerPos[2] > z - shockRange && playerPos[2] < z + shockRange));
return inDetonationRange;
}
return false;
}
// This sets the mine for defusal - the mine will trigger, but
// will instead trigger at the location of the owner, with the
// killer ID being that of the defuser.
bool defuse(int playerID)
{
if (defused || detonated)
{
return false;
}
bz_BasePlayerRecord *pr = bz_getPlayerByIndex(owner);
if (!pr || pr->team == eObservers)
{
bz_freePlayerRecord(pr);
return false;
}
bz_debugMessagef(DEBUG_VERBOSITY, "DEBUG :: Useless Mine :: Mine UID %s defused by %d", uid.c_str(), playerID);
defused = true;
defuserID = playerID;
float vector[3] = {0, 0, 0};
int explosionType = (int)ExplosionType::Defusal;
detonationShotID = bz_fireServerShot("SW", pr->lastKnownState.pos, vector, bz_getPlayerTeam(defuserID));
bz_setShotMetaData(detonationShotID, ww_shotType, explosionType);
bz_setShotMetaData(detonationShotID, ww_shotOwner, defuserID);
bz_setShotMetaData(detonationShotID, ww_mineOwner, owner);
bz_freePlayerRecord(pr);
return true;
}
// This sets the mine for detonation - the mine will trigger,
// killing the victim and setting the killer as the mine
// owner.
bool detonate()
{
if (detonated || defused || bz_getPlayerTeam(owner) == eObservers)
{
return false;
}
detonated = true;
float minePos[3] = {x, y, z};
float vector[3] = {0, 0, 0};
bz_debugMessagef(DEBUG_VERBOSITY, "DEBUG :: Useless Mine :: Mine UID %s detonated", uid.c_str());
// Fire the world weapon
int explosionType = (int)ExplosionType::Mine;
detonationShotID = bz_fireServerShot("SW", minePos, vector, team);
bz_setShotMetaData(detonationShotID, ww_shotType, explosionType);
bz_setShotMetaData(detonationShotID, ww_shotOwner, owner);
bz_setShotMetaData(detonationShotID, ww_mineOwner, owner);
return true;
}
};
private:
int getMineCount();
void loadConfiguration(const char* commandline);
void reloadDeathMessages();
void reloadDefusalMessages();
void removePlayerMines(int playerID);
void removeMine(Mine &mine);
void sendDefuseMessage(int defuserID, int mineOwnerID, int victimID);
void sendDeathMessage(int mineOwner, int victimID);
void setMine(int owner, float pos[3], bz_eTeamType team);
std::string formatMineMessage(std::string msg, std::string mineOwner, std::string defuserOrVictim);
std::string parsePath(bz_ApiString path);
std::vector<std::string> deathMessages; // A vector that will store all of the witty death messages
std::vector<std::string> defusalMessages; // A vector that will store all of the witty defusal messages
std::vector<Mine> activeMines; // A vector that will store all of the mines currently on the field
std::string deathMessagesFile; // The path to the file containing death messages
std::string defusalMessagesFile; // The path to the file containing defusal messages
double playerSpawnTime[256]; // The time a player spawned last; used for _mineSafetyTime calculations
const char* bzdb_safetyTime = "_mineSafetyTime";
};
BZ_PLUGIN(UselessMine)
const char* UselessMine::Mine::ww_shotType = "shotType";
const char* UselessMine::Mine::ww_shotOwner = "shotOwner";
const char* UselessMine::Mine::ww_mineOwner = "mineOwner";
const char* UselessMine::Name(void)
{
static std::string pluginName;
if (pluginName.empty())
{
pluginName = bz_format("%s %d.%d.%d (%d)", PLUGIN_NAME.c_str(), MAJOR, MINOR, REV, BUILD);
}
return pluginName.c_str();
}
void UselessMine::Init(const char* commandLine)
{
Register(bz_eFlagGrabbedEvent);
Register(bz_ePlayerDieEvent);
Register(bz_ePlayerPartEvent);
Register(bz_ePlayerSpawnEvent);
Register(bz_ePlayerUpdateEvent);
bz_registerCustomSlashCommand("mine", this);
bz_registerCustomSlashCommand("minecount", this);
bz_registerCustomSlashCommand("minestats", this);
bz_registerCustomSlashCommand("reload", this);
bz_RegisterCustomFlag("BD", "Bomb Defusal", "Safely defuse enemy mines while killing the mine owners", 0, eGoodFlag);
bz_registerCustomBZDBInt(bzdb_safetyTime, 5);
loadConfiguration(commandLine);
reloadDeathMessages();
reloadDefusalMessages();
if (deathMessages.empty())
{
bz_debugMessage(2, "WARNING :: Useless Mine :: No witty death messages were loaded");
}
else
{
bz_debugMessagef(2, "DEBUG :: Useless Mine :: %d witty death messages were loaded", deathMessages.size());
}
if (defusalMessages.empty())
{
bz_debugMessage(2, "WARNING :: Useless Mine :: No witty defusal messages were loaded");
}
else
{
bz_debugMessagef(2, "DEBUG :: Useless Mine :: %d witty defusal messages were loaded", defusalMessages.size());
}
}
void UselessMine::Cleanup(void)
{
Flush();
bz_removeCustomSlashCommand("mine");
bz_removeCustomSlashCommand("minecount");
bz_removeCustomSlashCommand("minestats");
bz_removeCustomSlashCommand("reload");
bz_removeCustomBZDBVariable(bzdb_safetyTime);
}
void UselessMine::Event(bz_EventData *eventData)
{
switch (eventData->eventType)
{
case bz_eFlagGrabbedEvent:
{
bz_FlagGrabbedEventData_V1* flagGrabData = (bz_FlagGrabbedEventData_V1*)eventData;
// If the user grabbed the Useless flag, let them know they can place a mine
if (strcmp(flagGrabData->flagType, "US") == 0)
{
bz_sendTextMessage(BZ_SERVER, flagGrabData->playerID, "You grabbed a Useless flag! Type /mine at any time to set a useless mine!");
}
}
break;
case bz_ePlayerDieEvent:
{
bz_PlayerDieEventData_V1* dieData = (bz_PlayerDieEventData_V1*)eventData;
int victimID = dieData->playerID;
uint32_t shotGUID = bz_getShotGUID(dieData->killerID, dieData->shotID);
// Only handle shots that have this plugin's metadata
if (bz_shotHasMetaData(shotGUID, Mine::ww_shotType))
{
ExplosionType shotType = (ExplosionType)bz_getShotMetaDataI(shotGUID, Mine::ww_shotType);
// Reassign the killer ID to the mine owner or the bomb defuser
if (shotType == ExplosionType::Mine || shotType == ExplosionType::Defusal)
{
int shotOwnerID = bz_getShotMetaDataI(shotGUID, Mine::ww_shotOwner);
int mineOwnerID = bz_getShotMetaDataI(shotGUID, Mine::ww_mineOwner);
dieData->killerID = shotOwnerID;
if (shotType == ExplosionType::Mine)
{
sendDeathMessage(mineOwnerID, victimID);
}
else if (shotType == ExplosionType::Defusal)
{
sendDefuseMessage(shotOwnerID, mineOwnerID, victimID);
}
}
}
}
break;
case bz_ePlayerPartEvent:
{
bz_PlayerJoinPartEventData_V1* partData = (bz_PlayerJoinPartEventData_V1*)eventData;
int playerID = partData->playerID;
// Remove all the mines belonging to the player who just left
removePlayerMines(playerID);
playerSpawnTime[playerID] = -1;
}
break;
case bz_ePlayerSpawnEvent:
{
bz_PlayerSpawnEventData_V1* spawnData = (bz_PlayerSpawnEventData_V1*)eventData;
int playerID = spawnData->playerID;
// Save the time the player spawned last
playerSpawnTime[playerID] = bz_getCurrentTime();
}
break;
case bz_ePlayerUpdateEvent:
{
bz_PlayerUpdateEventData_V1* updateData = (bz_PlayerUpdateEventData_V1*)eventData;
int playerID = updateData->playerID;
bool bypassSafetyTime = (playerSpawnTime[playerID] + bz_getBZDBInt(bzdb_safetyTime) <= bz_getCurrentTime());
bz_BasePlayerRecord *pr = bz_getPlayerByIndex(playerID);
bz_debugMessagef(DEBUG_VERBOSITY, "DEBUG :: Useless Mine :: player #%d at {%0.2f, %0.2f, %0.2f}",
playerID, updateData->state.pos[0], updateData->state.pos[1], updateData->state.pos[2]);
for (Mine &mine : activeMines)
{
if (mine.canPlayerTriggerMine(pr, updateData->state.pos) && bypassSafetyTime)
{
bz_debugMessagef(DEBUG_VERBOSITY, "DEBUG :: Useless Mine :: player %d located inside mine %s trigger",
playerID, mine.uid.c_str());
bool mineWentBoom = (pr->currentFlag == "Bomb Defusal (+BD)") ? mine.defuse(playerID) : mine.detonate();
// Only break if we successfully triggered a mine; otherwise we're just in the same area as a stale
// mine so move on to check the next mine
if (mineWentBoom)
{
removeMine(mine);
break;
}
}
}
bz_freePlayerRecord(pr);
}
break;
default:
break;
}
}
bool UselessMine::SlashCommand(int playerID, bz_ApiString command, bz_ApiString /*message*/, bz_APIStringList *params)
{
if (command == "mine")
{
bz_BasePlayerRecord *pr = bz_getPlayerByIndex(playerID);
if (pr->team != eObservers)
{
// Check if the player has the Useless flag
if (pr->currentFlag == "USeless (+US)")
{
// Store their current position
float currentPosition[3] = {pr->lastKnownState.pos[0], pr->lastKnownState.pos[1], pr->lastKnownState.pos[2]};
setMine(playerID, currentPosition, pr->team);
}
else
{
bz_sendTextMessage(BZ_SERVER, playerID, "You can't place a mine without the Useless flag!");
}
}
else
{
bz_sendTextMessage(BZ_SERVER, playerID, "Silly observer, you can't place a mine.");
}
bz_freePlayerRecord(pr);
return true;
}
else if (command == "minecount")
{
bz_sendTextMessagef(BZ_SERVER, playerID, "There are currently %d active mines on the field", getMineCount());
return true;
}
else if (command == "minestats")
{
bz_sendTextMessagef(BZ_SERVER, playerID, "Player Mines");
bz_sendTextMessagef(BZ_SERVER, playerID, "------------");
std::map<std::string, int> mineCount;
for (Mine &mine : activeMines)
{
if (mine.isStale())
{
continue;
}
mineCount[bz_getPlayerCallsign(mine.owner)]++;
}
rmap mineList;
for (auto i : mineCount)
{
mineList.insert(rmap::value_type(i.second, i.first));
}
for (auto i : mineList)
{
bz_sendTextMessagef(BZ_SERVER, playerID, "%-32s %d", i.second.c_str(), i.first);
}
return true;
}
else if (command == "reload" && bz_hasPerm(playerID, "setAll"))
{
if (params->size() == 0)
{
reloadDeathMessages();
reloadDefusalMessages();
}
else if (params->get(0) == "deathmessages")
{
reloadDeathMessages();
bz_sendTextMessage(BZ_SERVER, playerID, "Death messages reloaded");
return true;
}
else if (params->get(0) == "defusalmessages")
{
reloadDefusalMessages();
bz_sendTextMessage(BZ_SERVER, playerID, "Defusal messages reloaded");
return true;
}
}
return false;
}
// A function to format death messages in order to replace placeholders with callsigns and values
std::string UselessMine::formatMineMessage(std::string msg, std::string mineOwner, std::string defuserOrVictim)
{
bz_ApiString formattedMessage = msg;
formattedMessage.replaceAll("%owner%", mineOwner.c_str());
formattedMessage.replaceAll("%victim%", defuserOrVictim.c_str());
formattedMessage.replaceAll("%defuser%", defuserOrVictim.c_str());
formattedMessage.replaceAll("%minecount%", std::to_string(getMineCount()).c_str());
return formattedMessage;
}
void UselessMine::sendDefuseMessage(int defuserID, int mineOwnerID, int victimID)
{
const char* defuserCallsign = bz_getPlayerCallsign(defuserID);
const char* mineOwnerCallsign = bz_getPlayerCallsign(mineOwnerID);
const char* victimCallsign = bz_getPlayerCallsign(victimID);
if (!defuserCallsign || !mineOwnerCallsign || !victimCallsign)
{
return;
}
if (victimID == mineOwnerID)
{
if (defusalMessages.empty())
{
// Let the BD player know that they killed the owner
bz_sendTextMessagef(BZ_SERVER, defuserID, "You defused %s's mine", mineOwnerCallsign);
// Let the owner know that they were killed by the BD player
bz_sendTextMessagef(BZ_SERVER, mineOwnerID, "You were killed by %s's mine defusal", defuserCallsign);
}
else
{
// The random number used to fetch a random taunting defusal message
int randomNumber = rand() % defusalMessages.size();
// Get a random defusal message
std::string defusalMessage = defusalMessages.at(randomNumber);
bz_sendTextMessage(BZ_SERVER, BZ_ALLUSERS, formatMineMessage(defusalMessage, mineOwnerCallsign, defuserCallsign).c_str());
}
}
else
{
// If the victim wasn't the owner, then send a different message
bz_sendTextMessagef(BZ_SERVER, BZ_ALLUSERS, "%s was killed by %s's mine defusal.", victimCallsign, defuserCallsign);
}
}
void UselessMine::sendDeathMessage(int mineOwner, int victimID)
{
const char* mineOwnerCallsign = bz_getPlayerCallsign(mineOwner);
if (!mineOwnerCallsign)
{
return;
}
if (victimID == mineOwner)
{
// If the owner was killed with their own mine, send a message
bz_sendTextMessagef(BZ_SERVER, BZ_ALLUSERS, "%s was owned by their own mine!", mineOwnerCallsign);
return;
}
if (deathMessages.empty())
{
// If there are no death messages, explain to the user that it was a mine that killed them
bz_sendTextMessagef(BZ_SERVER, victimID, "You were killed by %s's mine", mineOwnerCallsign);
}
else
{
// The random number used to fetch a random taunting death message
int randomNumber = rand() % deathMessages.size();
std::string deathMessage = deathMessages.at(randomNumber);
const char* mineVictimCallsign = bz_getPlayerCallsign(victimID);
if (!mineVictimCallsign)
{
return;
}
bz_sendTextMessage(BZ_SERVER, BZ_ALLUSERS, formatMineMessage(deathMessage, mineOwnerCallsign, mineVictimCallsign).c_str());
}
}
void UselessMine::loadConfiguration(const char *commandline)
{
deathMessagesFile = "";
defusalMessagesFile = "";
// This expects two command line parameters: the death messages file and the defusal messages file.
bz_APIStringList cmdLineParams;
cmdLineParams.tokenize(commandline, ",");
if (cmdLineParams.size() >= 1)
{
deathMessagesFile = parsePath(cmdLineParams.get(0));
}
if (cmdLineParams.size() >= 2)
{
defusalMessagesFile = parsePath(cmdLineParams.get(1));
}
}
std::string UselessMine::parsePath(bz_ApiString path)
{
std::string lower = bz_tolower(path.c_str());
if (lower == "null")
{
return "";
}
return path;
}
// Reload the death messages
void UselessMine::reloadDeathMessages()
{
deathMessages.clear();
if (!deathMessagesFile.empty())
{
deathMessages = getFileTextLines(deathMessagesFile);
}
}
// Reload the defusal messages
void UselessMine::reloadDefusalMessages()
{
defusalMessages.clear();
if (!defusalMessagesFile.empty())
{
defusalMessages = getFileTextLines(defusalMessagesFile);
}
}
// Get the amount of active mines that exist
int UselessMine::getMineCount()
{
int count = 0;
for (Mine &m : activeMines)
{
if (!m.isStale())
{
count++;
}
}
return count;
}
// Remove a specific mine
void UselessMine::removeMine(Mine &mine)
{
const char* uid = mine.uid.c_str();
bz_debugMessagef(DEBUG_VERBOSITY, "DEBUG :: Useless Mine :: Removing mine UID: %s", mine.uid.c_str());
bz_debugMessagef(DEBUG_VERBOSITY, "DEBUG :: Useless Mine :: mine count: %d", getMineCount());
activeMines.erase(
std::remove_if(
activeMines.begin(),
activeMines.end(),
[uid](Mine &m) {
bool result = (m.uid == uid);
if (result)
{
bz_debugMessagef(DEBUG_VERBOSITY, "DEBUG :: Useless Mine :: Mine %s removed", uid);
}
return result;
}
),
activeMines.end()
);
bz_debugMessagef(DEBUG_VERBOSITY, "DEBUG :: Useless Mine :: new mine count: %d", getMineCount());
}
// Remove all of the mines of a specific player
void UselessMine::removePlayerMines(int playerID)
{
bz_debugMessagef(DEBUG_VERBOSITY, "DEBUG :: Useless Mine :: Removing all mines for player %d", playerID);
activeMines.erase(
std::remove_if(
activeMines.begin(),
activeMines.end(),
[playerID](Mine &m) { return m.owner == playerID; }
),
activeMines.end()
);
}
// A shortcut to set a mine
void UselessMine::setMine(int owner, float pos[3], bz_eTeamType team)
{
// Remove their flag because they "converted" it into a mine
bz_removePlayerFlag(owner);
Mine newMine(owner, pos, team);
bz_debugMessagef(DEBUG_VERBOSITY, "DEBUG :: Useless Mine :: Mine UID %s created by %d", newMine.uid.c_str(), owner);
bz_debugMessagef(DEBUG_VERBOSITY, "DEBUG :: Useless Mine :: x, y, z => %0.2f, %0.2f, %0.2f", pos[0], pos[1], pos[2]);
activeMines.push_back(newMine);
}