keyvalues: adjust KvSavePosition return value to implementation (#757)

The current ``KvSavePosition`` definition does not reflect the behaviour seen in [core/smn_keyvalues.cpp#L973-L981](https://github.com/alliedmodders/sourcemod/blob/404e96ad456531e9029f3b02b243a5284efd9691/core/smn_keyvalues.cpp#L973-L981). This can cause problems if some procedure on sp expects ``KvSavePosition`` to always add one node to the stack, no matter if there is no higher node.

Co-authored-by: peace-maker <[email protected]>
This commit is contained in:
fakuivan
2023-03-29 21:06:36 -07:00
committed by GitHub
co-authored by peace-maker
parent 8826663186
commit 6670b93cc6
+4 -2
View File
@@ -241,7 +241,8 @@ methodmap KeyValues < Handle
// have the previous key saved for backwards traversal.
//
// @param kv KeyValues Handle.
public native void SavePosition();
// @return True on success, false if there is no higher node.
public native bool SavePosition();
// Jumps back to the previous position. Returns false if there are no
// previous positions (i.e., at the root node). This should be called
@@ -523,9 +524,10 @@ native bool KvGotoNextKey(Handle kv, bool keyOnly=true);
* have the previous key saved for backwards traversal.
*
* @param kv KeyValues Handle.
* @return True on success, false if there is no higher node.
* @error Invalid Handle.
*/
native void KvSavePosition(Handle kv);
native bool KvSavePosition(Handle kv);
/**
* Removes the given key from the current position.