Skip to content
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

Closed
wants to merge 2 commits into from

Conversation

LtRipley36706
Copy link
Member

Changes fix spawning of various items across Dereth.

this.PhysicsData.DefaultScript = baseAceObject.DefaultScript;
this.PhysicsData.DefaultScriptIntensity = baseAceObject.DefaultScriptIntensity;
this.PhysicsData.Elastcity = baseAceObject.Elasticity;
this.PhysicsData.EquipperPhysicsDescriptionFlag = EquipMask.Wand;
Copy link
Member Author

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.

Copy link
Contributor

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)
{
Copy link
Member Author

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

Copy link
Contributor

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;
Copy link
Member Author

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;
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what is 0x65?

Copy link
Contributor

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;
Copy link
Member Author

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)

Copy link
Contributor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants