ITLongwell / mondains-legacy

Automatically exported from code.google.com/p/mondains-legacy
0 stars 0 forks source link

ML Quest System - Completed & Failed returns not correct values #66

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Im using SVN 39 but the problem comes from an older revison.

For all quests where AllObjectives = false property Completed returns True
even if no one of objectives actually has been completed. I not tested
Failed property but i think it have some other glitch like Completed prop.

I maked fix on my shard:

        public bool Completed
        {
            get
            {
                int completed = 0;

                for( int i = 0; i < m_Objectives.Count; i++ )
                {
                    if( m_Objectives[i].Completed )
                    {
                        if( !AllObjectives )
                        {
                            return true;
                        }
                        else
                        {
                            completed++;
                        }
                    }
                }

                return AllObjectives ? completed == m_Objectives.Count : false;
            }
        }

        public bool Failed
        {
            get
            {
                int failed = 0;

                for( int i = 0; i < m_Objectives.Count; i++ )
                {
                    if( m_Objectives[i].Failed )
                    {
                        if( AllObjectives )
                        {
                            return true;
                        }
                        else
                        {
                            failed++;
                        }
                    }
                }

                return !AllObjectives ? failed == m_Objectives.Count : false;
            }
        }

Original issue reported on code.google.com by natan.za...@gmail.com on 14 Feb 2009 at 6:59

GoogleCodeExporter commented 8 years ago
Fixed in SVN 40.

Original comment by gje...@gmail.com on 19 Feb 2009 at 10:09