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

World fix and fireball test #195

Merged
merged 13 commits into from
Apr 3, 2017
Merged

World fix and fireball test #195

merged 13 commits into from
Apr 3, 2017

Conversation

Forbiddenz
Copy link
Contributor

Clean up - Synced with Latest Prs

public Position Velocity;
public Position Omega; // rotation
public AceVector3 Velocity;
public AceVector3 Omega; // rotation
Copy link
Contributor

Choose a reason for hiding this comment

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

In PhysicsData.cs line 51, please consider if the constructor needs to have some base values:

      public PhysicsData()
        {
            Velocity = new AceVector3(0.0f, 0.0f, 0.0f);
            Omega = new AceVector3(0.0f, 0.0f, 0.0f);
        }

It is worth checking because I had been getting a crash where Velocity was null, when a character was logging into the server.

Copy link
Contributor

@Mogwai-TheFurry Mogwai-TheFurry left a comment

Choose a reason for hiding this comment

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

Overall, I'm really excited to see that we're getting spells going. Everything looks good except the new class - I don't think it's necessary. Also, merge conflicts.

/// <summary>
/// Spell Entity
/// </summary>
public class SpellEntity : MutableWorldObject
Copy link
Contributor

Choose a reason for hiding this comment

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

This needs a better name. Is there a particular reason a spell gets an entire class definition, though? The only difference I see here is that it has a PlayScript implementation that creates an Effect. There's nothing about the class definition that tells me it's a spell. I think this could have been done in MutableWorldObject as is, with all the Physics values being passed into a constructor, and then checking the PhysicsData.PhysicsState in the PlayScript method.

Also, I recall seeing a video of multiple effects. Was that not yours? Is that implemented here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I wanted to keep it separate because I am not sure yet what all it will needed,
But PlayScript may have to be far more advanced as we learn more.

I don't want to put all that logic in all mutable objects, I think it would create a mess as things progress. for now I thinks its best to keep them separated.

And if we find other objects with different code then PlayScript, we can then make it more generic if we keep them separated. Code will be a little bigger but much easier to read in the long run as we have different kinds of Entities.

switch (templateId)
{
case 0:
wo.SpellID = Spell.FlameBolt;
Copy link
Contributor

Choose a reason for hiding this comment

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

yeah, as I said above, these values should be pushed into the MutableWorldObject constructor instead of being replaced after instantiation.

@@ -19,7 +19,7 @@ public abstract class WorldObject
/// <summary>
/// wcid - stands for weenie class id
/// </summary>
public ushort WeenieClassid { get; protected set; }
public ushort WeenieClassid { get; set; }
Copy link
Contributor

Choose a reason for hiding this comment

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

I told you repeatedly to not do this.

{

ushort weenieClassId = 0;
MutableWorldObject mobj = new MutableWorldObject(ObjectType.MissileWeapon, new ObjectGuid(CommonObjectFactory.DynamicObjectId, GuidType.None), "Spell", weenieClassId, ObjectDescriptionFlag.None, WeenieHeaderFlag.Spell, position);
Copy link
Contributor

Choose a reason for hiding this comment

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

pull your switch block above this to find out what weenieClassId you need and pass it in. We discussed this several times.

@Mogwai-TheFurry Mogwai-TheFurry merged commit f4cda4a into ACEmulator:master Apr 3, 2017
@Forbiddenz Forbiddenz deleted the WorldFixAndFireballTest branch April 6, 2017 11:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants