clean up tnt code a bit

This commit is contained in:
darkrose 2013-10-30 13:50:33 +10:00
parent 72e50c9831
commit 6d6a71cd61
2 changed files with 5 additions and 4 deletions

View File

@ -638,5 +638,9 @@ std::string TNTNodeMetadata::infoText()
if (!m_armed)
return std::string("");
return std::string("Armed Explosive: ")+itos((int)ceil(m_time))+" seconds till detonation";
int s = (int)ceil(m_time);
if (s < 1)
return std::string("Armed Explosive: about to detonate");
return std::string("Armed Explosive: ")+itos(s)+" seconds till detonation";
}

View File

@ -162,9 +162,6 @@ public:
virtual std::string infoText();
virtual bool step(float dtime);
//float getTime() {return m_time;}
//bool getArmed() {return m_armed;}
//void setArmed(bool state) {m_armed = state; if (state) m_time = 5.0;}
virtual bool energise(u8 level, v3s16 powersrc, v3s16 signalsrc, v3s16 pos)
{
if (level == 0) {