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:
@@ -241,7 +241,8 @@ methodmap KeyValues < Handle
|
|||||||
// have the previous key saved for backwards traversal.
|
// have the previous key saved for backwards traversal.
|
||||||
//
|
//
|
||||||
// @param kv KeyValues Handle.
|
// @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
|
// Jumps back to the previous position. Returns false if there are no
|
||||||
// previous positions (i.e., at the root node). This should be called
|
// 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.
|
* have the previous key saved for backwards traversal.
|
||||||
*
|
*
|
||||||
* @param kv KeyValues Handle.
|
* @param kv KeyValues Handle.
|
||||||
|
* @return True on success, false if there is no higher node.
|
||||||
* @error Invalid Handle.
|
* @error Invalid Handle.
|
||||||
*/
|
*/
|
||||||
native void KvSavePosition(Handle kv);
|
native bool KvSavePosition(Handle kv);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Removes the given key from the current position.
|
* Removes the given key from the current position.
|
||||||
|
|||||||
Reference in New Issue
Block a user