-
Notifications
You must be signed in to change notification settings - Fork 241
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Correct DebugObject #334
Correct DebugObject #334
Conversation
this.PhysicsData.DefaultScript = baseAceObject.DefaultScript; | ||
this.PhysicsData.DefaultScriptIntensity = baseAceObject.DefaultScriptIntensity; | ||
this.PhysicsData.Elastcity = baseAceObject.Elasticity; | ||
this.PhysicsData.EquipperPhysicsDescriptionFlag = EquipMask.Wand; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Everything spawned with DebugObject can't have EquipMask.Wand.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yea - bug for sure. I thought I had fixed that.
if (this.PhysicsData.AnimationFrame != 0) | ||
{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Single line Ifs don't need brackets, per code style
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought Mogwai told me not to do that - my bad.
|
||
// I think this is wrong - we need the weenieClassId from weenie_class Leaving it for now | ||
// TODO: use view to return the correct value. | ||
this.WeenieClassid = baseAceObject.AceObjectId; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was already set above
if ((this.Type & (ObjectType.Creature | ObjectType.LifeStone | ObjectType.Portal)) == 0) | ||
{ | ||
// because this comes from PCAP data - on create we are not animating. | ||
this.PhysicsData.AnimationFrame = 0x65; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what is 0x65?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
that is base animation frame. With my if code above, I wanted to exclude lifestones, portals and creatures. It should be cleaned up in the database. If the pcap saw this equipped and id it the animation frame is set for wielded. If spawned or dropped items are not 0x65 (101) they are at about a 70% angle from the surface. at 0x65 they lay flat on the ground. That if statement for this debug code.
|
||
// Creating from a pcap of the weenie - this will be set by the loot generation factory. Og II | ||
this.PhysicsData.PhysicsDescriptionFlag &= ~PhysicsDescriptionFlag.Parent; | ||
this.GameData.ValidLocations = (EquipMask)baseAceObject.ValidLocations; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not everything spawned with create is equip-able.
if ((this.Type & (ObjectType.Creature | ObjectType.LifeStone | ObjectType.Portal)) == 0)
Probably needs something more like this, not totally sure however.
if ((this.Type & ObjectType.Creature) == 0 | (this.Type & ObjectType.LifeStone) == 0 | (this.Type & ObjectType.Portal) == 0)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep did a quick and dirty to leave out lifestones, portals and creatures. I knew they could not be contained or equipped. Also the database for non equipable items puts a 0 which is the makes it safe to load it anyway. createobject has a pcap with a value in that field non zero plus the bit flags tells us to act on it. I don't think you should delete those lines.
Changes fix spawning of various items across Dereth.