summaryrefslogtreecommitdiff
path: root/src/game-server/monster.cpp
diff options
context:
space:
mode:
authorErik Schilling <ablu.erikschilling@googlemail.com>2013-05-19 11:40:50 +0200
committerErik Schilling <ablu.erikschilling@googlemail.com>2013-08-26 22:56:47 +0200
commit4d46079cd147e05513473860cb2e92fec0c31b8f (patch)
tree0f115a91debb6be766a174e8042ff800aff3a0ec /src/game-server/monster.cpp
parent6d14024f3df86c05e94f2b4161faf8f5d97c2c0f (diff)
downloadmanaserv-4d46079cd147e05513473860cb2e92fec0c31b8f.tar.gz
manaserv-4d46079cd147e05513473860cb2e92fec0c31b8f.tar.bz2
manaserv-4d46079cd147e05513473860cb2e92fec0c31b8f.tar.xz
manaserv-4d46079cd147e05513473860cb2e92fec0c31b8f.zip
Allow names instead of ids for attributes + cleanup
I did not adapt the scripts yet since we need some special handling for the attributes which are required by the server directly. So you still have to use the ids for those. I will change that later. In the future I want to use the AttributeInfo class instead of the int id everywhere possible. So I did a small start on that too.
Diffstat (limited to 'src/game-server/monster.cpp')
-rw-r--r--src/game-server/monster.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/game-server/monster.cpp b/src/game-server/monster.cpp
index a40c24a4..30be1201 100644
--- a/src/game-server/monster.cpp
+++ b/src/game-server/monster.cpp
@@ -53,7 +53,7 @@ MonsterComponent::MonsterComponent(Entity &entity, MonsterClass *specy):
for (auto attrInfo : attributeManager->getAttributeScope(MonsterScope))
{
- beingComponent->createAttribute(attrInfo.first, *attrInfo.second);
+ beingComponent->createAttribute(attrInfo.first, attrInfo.second);
}
/*
@@ -71,7 +71,8 @@ MonsterComponent::MonsterComponent(Entity &entity, MonsterClass *specy):
double factor = 100 + (rand() % (mutation * 2)) - mutation;
attributeValue = attributeValue * factor / 100.0;
}
- beingComponent->setAttribute(entity, attribute.first, attributeValue);
+ beingComponent->setAttribute(entity, attribute.first->id,
+ attributeValue);
}
beingComponent->setGender(specy->getGender());