summaryrefslogtreecommitdiff
path: root/src/genericobject.cpp
Commit message (Expand)AuthorAge
* Add sneak and sneak_glitch to set_physics_override()PilzAdam2013-12-03
* Allow modifying movement speed, jump height and gravity per-player via the Lu...MirceaKitsune2013-04-05
* Update Copyright YearsSfan52013-02-24
* Change Minetest-c55 to MinetestPilzAdam2013-02-24
* Fix Taoki's messed up generic object command idsPerttu Ahola2012-11-29
* A bunch of fixesMirceaKitsune2012-11-25
* Send animations, bone overrides and attachments in entity initialization. Cli...MirceaKitsune2012-11-25
* Complete the attachment framework.MirceaKitsune2012-11-25
* Framework for the attachment system, new object property which allows changin...MirceaKitsune2012-11-25
* Get the new animation framework properly workingMirceaKitsune2012-11-25
* Joint positioning and rotation code, and fix a problem related to their lua APIMirceaKitsune2012-11-25
* Properly and efficiently use split utility headersPerttu Ahola2012-06-17
* Switch the license to be LGPLv2/later, with small parts still remaining as GP...Perttu Ahola2012-06-05
* Fix dropped nodeitem visualsPerttu Ahola2012-04-04
* ObjectPropertiesPerttu Ahola2012-03-30
* Use GenericCAO in place of LuaEntityCAO and PlayerCAOPerttu Ahola2012-03-29
ject(ServerEnvironment *env, v3f pos): ActiveObject(0), m_known_by_count(0), m_removed(false), m_pending_deactivation(false), m_static_exists(false), m_static_block(1337,1337,1337), m_env(env), m_base_position(pos) { } ServerActiveObject::~ServerActiveObject() { } ServerActiveObject* ServerActiveObject::create(u8 type, ServerEnvironment *env, u16 id, v3f pos, const std::string &data) { // Find factory function std::map<u16, Factory>::iterator n; n = m_types.find(type); if(n == m_types.end()) { // If factory is not found, just return. dstream<<"WARNING: ServerActiveObject: No factory for type=" <<type<<std::endl; return NULL; } Factory f = n->second; ServerActiveObject *object = (*f)(env, pos, data); return object; } void ServerActiveObject::registerType(u16 type, Factory f) { std::map<u16, Factory>::iterator n; n = m_types.find(type); if(n != m_types.end()) return; m_types[type] = f; } float ServerActiveObject::getMinimumSavedMovement() { return 2.0*BS; } ItemStack ServerActiveObject::getWieldedItem() const { const Inventory *inv = getInventory(); if(inv) { const InventoryList *list = inv->getList(getWieldList()); if(list && (getWieldIndex() < (s32)list->getSize())) return list->getItem(getWieldIndex()); } return ItemStack(); } bool ServerActiveObject::setWieldedItem(const ItemStack &item) { Inventory *inv = getInventory(); if(inv) { InventoryList *list = inv->getList(getWieldList()); if (list) { list->changeItem(getWieldIndex(), item); setInventoryModified(); return true; } } return false; }