Comments (7)
Best solution would be to add a function to look up for the spellbook and to use that on every occasion
from source-x.
Could this be a solution ? 🤔
if (uType & DAMAGE_MAGIC) // If the damage is magic
{
pWeapon = pSrc->LayerFind(LAYER_HAND1); // Search for an equipped spellbook hand 1
pWeapon2 = pSrc->LayerFind(LAYER_HAND2); // Search for an equipped spellbook hand 2
if (pWeapon) && (!pWeapon->IsTypeSpellbook() || (pWeapon2) && (!pWeapon2->IsTypeSpellbook()) ) // If there is nothing on the hand 1 or 2, or the item is not a spellbook.
{
pWeapon = pSrc->m_uidWeapon.ItemFind(); // then force a weapon find.
}
if (pWeapon2 && pWeapon2->IsTypeSpellbook())
pWeapon = pWeapon2;
}
from source-x.
Like Nolok said, better add a method like findlayerspellbook that replaces all the spellbook search code
from source-x.
A method is somthing like. Pchar->getspellbook(). ?
from source-x.
exactly
from source-x.
Fix sent.
from source-x.
Working exceptionaly!! Thank you ❤
from source-x.
Related Issues (20)
- serv.build debug HOT 1
- Remove appveyor build
- Human Corpse - invisible hair/beard
- CANMASK no save on server reboot HOT 2
- Height and width information of items HOT 10
- Not read correctly UOP map files HOT 1
- SQL Error: 21 HOT 7
- Items won't decay HOT 1
- Change body do not work anymore since dispid implementation HOT 2
- Discussion: Server layers system HOT 3
- @KILL -> SRC should be killer, not victim
- Chat Debug HOT 4
- Criminal & Guard Problem. HOT 2
- Summoned PK monster don't attack. HOT 3
- Follower Commands Don't Work. HOT 7
- t_crops HOT 3
- [Question] Weapon_GetAttack HOT 2
- t_spawn_item HOT 6
- Taming and OF_PetSlots bug? HOT 10
- Error setting more1/more2 Value on a spellbook (may affect other variable assignation) HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from source-x.