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

Loads of fixes and improvements. #101

Merged
merged 26 commits into from
Jun 25, 2016
Merged

Loads of fixes and improvements. #101

merged 26 commits into from
Jun 25, 2016

Conversation

Y-Less
Copy link
Member

@Y-Less Y-Less commented Jun 22, 2016

  1. Changed the semantics of Group_SetBalanced. If the player is already in a group, return that group instead of continuing. This is because removing a player from a group is tricky if that group contains other groups - should they be removed from those other groups as well? And what if they were added to those child groups independently, should they STILL be removed from that group when removed from the parent group? The simplest solution is to let the user remove players from any existing groups first, so that they know the correct removal semantics to use, THEN call Group_SetBalanced. This also changes the function to no longer take either a list OR an array, JUST a list, and adds Group_SetBalancedArray to make up the difference. Finally, the validity of groups has been moved, and more validation and flexibility added. Previously, if there was more than one group given that was considered fine, even if some were not valid groups. Now there must be at least one valid group given, but now one group is fine - just add them to that one.
  2. Added two new iterator functions:
new
    Iterator:iter<4, 10>
Iter_Add(iter<0>, 2);
Iter_Add(iter<0>, 3);
Iter_Add(iter<1>, 5);
Iter_Add(iter<2>, 6);
Iter_Add(iter<2>, 7);
Iter_Add(iter<3>, 9);

// Loops over all values in ANY part of the multi-iterator.
foreach (new i : All(iter<>))
{
    printf("%d", i);
}

// Output:
//   
//   2
//   3
//   5
//   6
//   7
//   9
//   

// Loops over values not in ANY part of the multi-iterator.
foreach (new i : None(iter<>))
{
    printf("%d", i);
}

// Output:
//   
//   0
//   1
//   4
//   8
//   
  1. Cleaned up y_malloc, and added YSI_NO_HEAP_MALLOC to use the old style y_malloc with a huge array instead of the heap. This MAY fix Problem with Y_dialog, Y_inline, mysql #62, |Bug| y_malloc ? #91 , y_inline won't work after few gmx [linux] #99, and Southclaw/ScavengeSurvive#248.
  2. General fixes for Warning y_iterate #97 and y_malloc #98.
  3. Changed how Zeex/amx_assembly is included. All the inclusions are now in one file, and the repository location is VERY forgiving.
  4. Added local state so certain special iterators. This is now possible:
foreach (new i : Random(10, 0, 100)) // count, min, max.
{
    foreach (new i : Random(10, 0, 100)) // count, min, max.
    {
    }
}

Previously, Random and a few other iterators used static variables within themselves to keep track of extra data, meaning that they couldn't be nested. Now that extra data is declared hidden within the foreach loop.

  1. Improved y_testing - better support for run-time errors, and lists the names of tests that failed in the summary instead of making you search through all the tests for the ones that failed.

Y-Less added 24 commits May 13, 2016 21:37
Merge code (half of which I wrote anyway).
This might fix the problem some people were having with y_dialog eventually stopping for no apparent reason.
@Y-Less
Copy link
Member Author

Y-Less commented Jun 23, 2016

  1. Improved y_testing - better support for run-time errors, and lists the names of tests that failed in the summary instead of making you search through all the tests for the ones that failed.

Note that this will still fail on very specific comment lines, where the close comment ("-->") spans column 130.
Because they were bigger than YSI_MAX_STRING, they would span two blocks and the parser wouldn't see the close comment.
@Y-Less Y-Less mentioned this pull request Jun 25, 2016
@Y-Less
Copy link
Member Author

Y-Less commented Jun 25, 2016

Fixed y_xml not parsing long lines correctly all the time. I still don't think it will work for writing.

@Y-Less Y-Less merged commit 4aa0975 into pawn-lang:YSI.tl Jun 25, 2016
@Crayder
Copy link
Collaborator

Crayder commented Jun 25, 2016

Not sure if you were notified, but I left a note in Misiur@4aa0975

@Y-Less
Copy link
Member Author

Y-Less commented Jun 25, 2016

I saw that. This new version tries to find amx_assembly in about six different places. As long as it is in one of those, you are fine. If another library uses it as well, you should only need one copy. in fact, I wrote the amx_assembly inclusion code in the introspect include and I know for a fact that it uses a similar search technique. The two should be entirely compatible with each other as long as amx_assembly is in some vaguely sensible location (like a subdirectory of YSI or pawno/includes).

The old code ONLY looked in a subdirectory of YSI.

@Y-Less
Copy link
Member Author

Y-Less commented Jun 25, 2016

https://github.com/Misiur/YSI-Includes/blob/4aa0975eef265038220435c367b520a6319a3eae/YSI_Internal/amx_assembly.inc#L6-L12

https://github.com/oscar-broman/samp-introspect/blob/915e6cb9d76fd783a793d9cc403d15237aadae7f/introspect.inc#L28-L31

They could actually both have more versions, but it probably isn't needed. Also don't forget that the compiler takes filenames in to account (at least the default one or Zeex's with -Z), so if one amx_assembly file was already included by one library, the compiler won't even bother looking for it a second time.

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.

2 participants