• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Compiling Monsters don't walking on new corpse (3777)

warriorfrog

Active Member
Joined
Jul 29, 2015
Messages
334
Reaction score
35
Hello guys im using trunk3777...

The BUG:
When u kill a monster, others dont walk on it, only if u walk on it..

SGPdkE.jpg


I made many changes on this souces
No use changing the code every source
Until 3777 because it is more stable than 3884

Then...

Any know how i need change to fix it?

I search so much and i find it:


They are not the same, 3884 do have some bugs fixed compared to 3777 that you will have to fix things, like monsters not walking over corpses.

According to Elf, Stian (the 2 who did the most on 0.4) 3777 is alot more stable on linux compared to 3884. But you can use both on both ofc.

Cyk, please help me brother

I've been working for 5+ hours here trying to fix this FU*** bug, but no success

The bug was fixed in rev 3814, they've changed these files:

/trunk/configmanager.cpp
/trunk/creature.cpp
/trunk/creature.h
/trunk/game.cpp

I've applied every change in creature.cpp and creature.h from REV 3777 to 3820, and didn't fuck*** work, also applied changes in game.cpp and configmanager.cpp of REV 3814, but didn't do it for previous versions

Can you please tell me how to fix this? Really appreciate.


So where? Whats i need change to fix it?
someone very experienced to help me?
If u help me u will help so much peoples :( ALL LOVE 3777! :D
 
Last edited:
If trunk 3884 is the stable version and you want to use 3777 for whatever reason there are a number changes that need to be made to 3777

There are roughly 78 source files (e.g. *.h, *.cpp) that differ from each other

If your focus is just monsters.cpp, monster.cpp, monsters.h, monster.h then these are the lines and its code where they differ in those 2 distros for the files mentioned.

trunk 3777 - monster.cpp
Code:
-- line 903
if((item = items->at(i)) && item->hasProperty(MOVEABLE) &&
trunk 3884 - monster.cpp
Code:
-- line 903
if((item = items->at(i)) && item->hasProperty(MOVABLE) &&
------------------------------
trunk 3777 - monster.cpp
Code:
-- line 1321
void Monster::setNormalCreatureLight()
trunk 3884 - monster.cpp
Code:
-- line 1321
void Monster::resetLight()
------------------------------
trunk 3777 -- monster.h
Code:
-- line 102
virtual void setNormalCreatureLight();
trunk 3884 -- monster.h
Code:
-- line 102
virtual void resetLight();
------------------------------
trunk 3777 -- monsters.cpp
Code:
-- starting on line 96 and ending on line 103
   Item* tmpItem = NULL;
   for(LootItems::const_iterator it = lootItems.begin(); it != lootItems.end() && !corpse->full(); ++it)
   {
     if((tmpItem = createLoot(*it)))
     {
       if(Container* container = tmpItem->getContainer())
       {
         if(createChildLoot(container, (*it)))
trunk 3884 -- monsters.cpp
Code:
-- line
-- starting on line 96 and ending on line 108
   ItemList items;
   for(LootItems::const_iterator it = lootItems.begin(); it != lootItems.end() && !corpse->full(); ++it)
   {
     items = createLoot(*it);
     if(items.empty())
       continue;

     for(ItemList::iterator iit = items.begin(); iit != items.end(); ++iit)
     {
       Item* tmpItem = *iit;
       if(Container* container = tmpItem->getContainer())
       {
         if(createChildLoot(container, *it))
--------------------------------
trunk 3777 -- monsters.cpp
Code:
-- starting on line 137 and ending on line 139
Item* MonsterType::createLoot(const LootBlock& lootBlock)
{
   uint16_t item = lootBlock.ids[0], random = Monsters::getLootRandom();
trunk 3884 -- monsters.cpp
Code:
-- starting on line 142 and ending on line 144
ItemList MonsterType::createLoot(const LootBlock& lootBlock)
{
   uint16_t item = lootBlock.ids[0], random = Monsters::getLootRandom(), count = 0;
--------------------------------
trunk 3777 - monsters.cpp
Code:
-- starting on line 144 and ending on line 167
   if(Item::items[item].stackable)
   {
     if(random < lootBlock.chance)
       tmpItem = Item::CreateItem(item, (random % lootBlock.count + 1));
   }
   else if(random < lootBlock.chance)
     tmpItem = Item::CreateItem(item, 0);

   if(!tmpItem)
     return NULL;

   if(lootBlock.subType != -1)
     tmpItem->setSubType(lootBlock.subType);

   if(lootBlock.actionId != -1)
     tmpItem->setActionId(lootBlock.actionId, false);

   if(lootBlock.uniqueId != -1)
     tmpItem->setUniqueId(lootBlock.uniqueId);

   if(!lootBlock.text.empty())
     tmpItem->setText(lootBlock.text);

   return tmpItem;
trunk 3884 - monsters.cpp
Code:
-- starting on line 148 and ending on line 178
   ItemList items;
   if(random < lootBlock.chance)
     count = random % lootBlock.count + 1;

   Item* tmpItem = NULL;
   while(count > 0)
   {
     uint16_t n = 1;
     if(Item::items[item].stackable)
       n = std::min(count, (uint16_t)100);

     if(!(tmpItem = Item::CreateItem(item, n)))
       break;

     count -= n;
     if(lootBlock.subType != -1)
       tmpItem->setSubType(lootBlock.subType);

     if(lootBlock.actionId != -1)
       tmpItem->setActionId(lootBlock.actionId, false);

     if(lootBlock.uniqueId != -1)
       tmpItem->setUniqueId(lootBlock.uniqueId);

     if(!lootBlock.text.empty())
       tmpItem->setText(lootBlock.text);

     items.push_back(tmpItem);
   }

   return items;
----------------------------------------
trunk 3777 -- monsters.cpp
Code:
-- starting on line 176 and ending on line 184
   Item* tmpItem = NULL;
   for(; it != lootBlock.childLoot.end() && !parent->full(); ++it)
   {
     if((tmpItem = createLoot(*it)))
     {
       if(Container* container = tmpItem->getContainer())
       {
         if(createChildLoot(container, (*it)))
           parent->__internalAddThing(container);
trunk 3884 -- monsters.cpp
Code:
-- starting on line 187 and ending on line 200
   ItemList items;
   for(; it != lootBlock.childLoot.end() && !parent->full(); ++it)
   {
     items = createLoot(*it);
     if(items.empty())
       continue;

     for(ItemList::iterator iit = items.begin(); iit != items.end(); ++iit)
     {
       Item* tmpItem = *iit;
       if(Container* container = tmpItem->getContainer())
       {
         if(createChildLoot(container, *it))
           parent->__internalAddThing(tmpItem);
------------------------------------
trunk 3777 - monsters.cpp
Code:
-- line 1500
lootBlock.count = std::max(1, std::min(100, intValue));
trunk 3884 - monsters.cpp
Code:
-- line 1516
lootBlock.count = intValue;
-------------------------------------
trunk 3777 -- monsters.h
Code:
-- line 90
Item* createLoot(const LootBlock& lootBlock);
trunk 3884 -- monsters.h
Code:
-- line 90
ItemList createLoot(const LootBlock& lootBlock);
 
Last edited:
Back
Top