summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/actions/pets.cpp4
-rw-r--r--src/net/eathena/serverfeatures.cpp5
-rw-r--r--src/net/eathena/serverfeatures.h2
-rw-r--r--src/net/serverfeatures.h2
-rw-r--r--src/net/tmwa/serverfeatures.cpp5
-rw-r--r--src/net/tmwa/serverfeatures.h2
6 files changed, 20 insertions, 0 deletions
diff --git a/src/actions/pets.cpp b/src/actions/pets.cpp
index 93bc9dc62..7d3e4c672 100644
--- a/src/actions/pets.cpp
+++ b/src/actions/pets.cpp
@@ -32,6 +32,7 @@
#include "net/chathandler.h"
#include "net/pethandler.h"
+#include "net/serverfeatures.h"
#include "utils/chatutils.h"
#include "utils/stringutils.h"
@@ -62,6 +63,9 @@ impHandler(commandEmotePet)
impHandler(talkPet)
{
+ if (!serverFeatures->haveTalkPet())
+ return false;
+
std::string args = event.args;
// in future probably need add channel detection
if (!localPlayer->getPets().empty())
diff --git a/src/net/eathena/serverfeatures.cpp b/src/net/eathena/serverfeatures.cpp
index ab458d052..b9a752946 100644
--- a/src/net/eathena/serverfeatures.cpp
+++ b/src/net/eathena/serverfeatures.cpp
@@ -205,4 +205,9 @@ bool ServerFeatures::haveCart() const
return true;
}
+bool ServerFeatures::haveTalkPet() const
+{
+ return serverVersion >= 5;
+}
+
} // namespace EAthena
diff --git a/src/net/eathena/serverfeatures.h b/src/net/eathena/serverfeatures.h
index 6406074ff..e738bb491 100644
--- a/src/net/eathena/serverfeatures.h
+++ b/src/net/eathena/serverfeatures.h
@@ -101,6 +101,8 @@ class ServerFeatures final : public Net::ServerFeatures
bool haveVending() const override final;
bool haveCart() const override final;
+
+ bool haveTalkPet() const override final;
};
} // namespace EAthena
diff --git a/src/net/serverfeatures.h b/src/net/serverfeatures.h
index 890a18a38..7eb3d07b2 100644
--- a/src/net/serverfeatures.h
+++ b/src/net/serverfeatures.h
@@ -98,6 +98,8 @@ class ServerFeatures notfinal
virtual bool haveVending() const = 0;
virtual bool haveCart() const = 0;
+
+ virtual bool haveTalkPet() const = 0;
};
} // namespace Net
diff --git a/src/net/tmwa/serverfeatures.cpp b/src/net/tmwa/serverfeatures.cpp
index 5ba2b1dac..58a62f1f6 100644
--- a/src/net/tmwa/serverfeatures.cpp
+++ b/src/net/tmwa/serverfeatures.cpp
@@ -204,4 +204,9 @@ bool ServerFeatures::haveCart() const
return false;
}
+bool ServerFeatures::haveTalkPet() const
+{
+ return true;
+}
+
} // namespace TmwAthena
diff --git a/src/net/tmwa/serverfeatures.h b/src/net/tmwa/serverfeatures.h
index d29c4287b..e3dba132e 100644
--- a/src/net/tmwa/serverfeatures.h
+++ b/src/net/tmwa/serverfeatures.h
@@ -101,6 +101,8 @@ class ServerFeatures final : public Net::ServerFeatures
bool haveVending() const override final;
bool haveCart() const override final;
+
+ bool haveTalkPet() const override final;
};
} // namespace TmwAthena